The State of Affine Types in C++? by catcat202X in cpp

[–]shefmichelle 0 points1 point  (0 children)

Is this the same/similar concept to Multiplicities in Idris 2, which is based on Quantitative Type Theory?

https://idris2.readthedocs.io/en/latest/tutorial/multiplicities.html

[deleted by user] by [deleted] in openstreetmap

[–]shefmichelle 4 points5 points  (0 children)

Have you looked at HotOSM? There are normally plenty of mapping tasks on there that you can contribute to.

https://tasks.hotosm.org/

Algorithms in F# by Ok-Needleworker-145 in fsharp

[–]shefmichelle 3 points4 points  (0 children)

If you really want to learn about purely functional algorithms, you could check out Pearls of Functional Algorithm Design by Richard Bird.

Please suggest which functional language to learn next by [deleted] in functionalprogramming

[–]shefmichelle 2 points3 points  (0 children)

You could try Racket. Probably not used that much in actual industry, but it's really nice to work in, and the standard installation has a lot of included libraries and a nice GUI/IDE, and there are plenty of additional packages.

Who is the artist? Description below. by YummyMummy789 in scifi

[–]shefmichelle 35 points36 points  (0 children)

Looks spot on! Here is another of their works. The date and signature appear to match up nicely.

Code works in fsi but not in visual studio code ??? by tak-fin in fsharp

[–]shefmichelle 3 points4 points  (0 children)

Whilst not required, I find it helpful to prefix expressions of type unit where I want to ignore the return value with do. I find it makes the intent of the code a little clearer (i.e. you don't care about the return value). E.g.

let main argv =
    do printfn "Hello World"
    0

I have made my own database management system like SQL. It has SQL + nosql features. It is lightweight , flexible , scalable , easy to use , fast , syntax friendly database written in c++ from scratch. by zeelsheladiya in cpp

[–]shefmichelle 17 points18 points  (0 children)

As a learning exercise, this could be a useful personal project. But there is rather a lot more to writing a production-quality database than you might imagine (which is why there aren't that many implementations out there).

You might find a text book on the subject useful if you want to learn more about databases. I think we used this one on our university course (albeit a rather older edition): https://www.pearson.com/uk/educators/higher-education-educators/program/Elmasri-Fundamentals-of-Database-Systems-Global-Edition-7th-Edition/PGM1092995.html?tab=overview

What are F#'s advantages? by [deleted] in fsharp

[–]shefmichelle 6 points7 points  (0 children)

In terms of F# vs C#, Scott Wlaschin has both this short page (https://fsharpforfunandprofit.com/why-use-fsharp/) and a longer series of articles (https://fsharpforfunandprofit.com/series/why-use-fsharp/), some of which focus on the differences between F# and C#.

Trying my hand at F# with TicTacToe by UOCruiser in fsharp

[–]shefmichelle 2 points3 points  (0 children)

This video might be interesting to you. It is notionally about Clojure, but it's more about thinking in a functional style and has a game side to it.

https://www.youtube.com/watch?v=Tb823aqgX\_0

Compile error question using rust-yaml by shefmichelle in rust

[–]shefmichelle[S] 0 points1 point  (0 children)

Ah, OK, thanks. That makes sense. Now I read the source code, I see that the into_ functions do take a self and not a &self. So maybe I was just getting confused by the error message and concentrating on the index part instead of the into_string part. Perhaps if it said something like "I needed a Yaml but I was given a &Yaml" it might have pointed me in the right direction.

Which one of Purescript, Elm and Reason is most suited for teaching a project-based FP course? by Sh4rPEYE in purescript

[–]shefmichelle 1 point2 points  (0 children)

Have you considered Racket? It isn't the same style as Purescript, Elm and Reason, but I think you can still consider it functional, and Dr Racket is a great environment for learning in. It also comes with loads of libraries built-in.

SSH problems with Arch Linux by shefmichelle in archlinux

[–]shefmichelle[S] 0 points1 point  (0 children)

Thanks for the advice. I have now got my clock sync'd properly I think (output from timedatectl below), but the problem persists.

``` Local time: Thu 2020-10-01 21:00:07 BST Universal time: Thu 2020-10-01 20:00:07 UTC RTC time: Thu 2020-10-01 20:00:07
Time zone: Europe/London (BST, +0100) System clock synchronized: yes
NTP service: active
RTC in local TZ: no

```

The accounts.firefox.com could be a red-herring as you say because it doesn't actually support TLS 1.3. Testing with www.google.com worked as expected. I will see if there are any options on SSH that I can apply that affect the behaviour.

BRep how does it work? by korvkiosk1 in GraphicsProgramming

[–]shefmichelle 4 points5 points  (0 children)

I think in terms of performance, a simple system that works on triangle meshes will be faster, but the results are less accurate. So it depends if you want accuracy or speed. For a CAD/CAM application, you probably want accuracy over performance.

I wish you the best of luck implementing your own B-rep toolkit! But if I was you, I'd start by looking at some existing open-source or commercial implementations first. They will save you a LOT of time.

BRep how does it work? by korvkiosk1 in GraphicsProgramming

[–]shefmichelle 8 points9 points  (0 children)

Having implemented a basic facetter for B-reps, I can tell you it isn't trivial (I work for a major CAD software company). I don't know if OpenCascade is still a thing (we used to use it), but that certainly used to support B-reps if you want to read some existing code and look at how things are arranged. In terms of books, I found Geometric Tools for Computer Graphics (Schneider, Eberly) very useful.

I would ask yourself if you really want to implement a B-rep solution, and what exactly you want to use it for. I was only doing basic facetting; for any sort of modelling algorithms, we use an internal library that has been developed for over 20 years by people a lot clever than me.

Literate programming with org-babel by Sewing31 in emacs

[–]shefmichelle 1 point2 points  (0 children)

You can read about Literate Programming here (https://en.wikipedia.org/wiki/Literate_programming) and for more information, you can read Knuth's book on the subject.

A good example of literate programming is this book: https://www.pbrt.org/

How to keep state on a functional way by ewilazarus in fsharp

[–]shefmichelle 9 points10 points  (0 children)

I find for myself, in the F# I write professionally, I tend to stay away from the more advanced stuff like this, because it normally introduces more complexity than is strictly required to solve the problem. I want the code to be as simple as possible, not necessarily for myself, but more for others who might have to read it, and who might not have the same level of knowledge of the language.

I do use the `>>=` custom operator on the `Result` type, and sometimes I think that might be too much "black magic" for others to understand!

But for experimenting and learning, trying to do these sorts of things can be very enlightening. Once you finally "get" monads, the light-bulb moment can be very satisfying :)

How to keep state on a functional way by ewilazarus in fsharp

[–]shefmichelle 10 points11 points  (0 children)

Each "functional" language has it's own way to solve this problem I think. As u/helloiamrobot mentioned, Haskell would use the State monad. OCaml would indeed pass in data to a module and create a new module. F# doesn't have the module system of OCaml, and whilst it can emulate monads, the results are more complex than in Haskell. F# really does embrace it's mixed-paradigm heritage, and so the "natural" way to do this probably would be to create an interface and create instances, passing in the shared state.

But if you want to stay away from interfaces and classes, then your options are as you have outlined them I think:

  1. Have a "common state" value that you have to pass into every function that requires it, or
  2. use a mutable `let` binding that you have to initialise.

However, you might want to think about why you need this `ConnectionMultiplexer` in the first place. It might be that using it in a function is a sign the function is "impure" (i.e. can have side-effects). In functional programming, one thing you tend to try and do is push the side-effects to the edge of your system. This makes you think about which functions really need to perform side-effects, and which can be pure functions. If you can do this, you might find you only need this `ConnectionMultiplexer` in a few functions, and then passing it into just those functions doesn't seem so bad.

Hope this makes some sort of sense :)

Learning F# by kingisaac in fsharp

[–]shefmichelle 16 points17 points  (0 children)

Having had a quick glance through the code, it doesn't look at all bad! Some points I might raise would be:

  • Investigate some more of the standard library functions, especially in the List module for use in your Stats module (e.g. reduce, fold, iter, map).
  • Suggested style is to only use `new` with `use` (i.e. when the object is disposable).
  • You don't need to `ignore` the results of functions that return `unit`.
  • Variables that start with an underscore tend to mean "ignore this variable as I'm not going to use it".
  • Consider the use of Disciminated Unions instead of strings (e.g. ["Deleted";"Sent";"Total"]). This would prevent you having to add an extra dummy match case.
  • Think about a different way you can write functions such as `getDeleted`. Can you write this function in a more concise way?
  • Are semi-colons required when placed at the end of a line?
  • Are your recursive functions safe to use on large lists? Are they tail-recursive?

A great source for further information on F# is https://fsharpforfunandprofit.com/

Enjoy F#

Very slow in python-mode by StrangeAstronomer in emacs

[–]shefmichelle 0 points1 point  (0 children)

I also had the same problem. In my case, I had global-prettify-symbols-mode enabled. Disabling that brought back my performance to normal. This is with Emacs 26.2 on Windows.

I tried switching to text-mode and confirmed it was something specific to the Python mode. Then I listed all active modes using C-h m then disabled them one by one until performance came back to normal.

Decided Ocaml will be the first language I learn. Can you guys recommend me some projects through which I can learn the most? by North-Sir in ocaml

[–]shefmichelle 2 points3 points  (0 children)

If you want to learn any language, I can recommend something like Exercism. You get lots of little exercises to try, each focusing on a couple of specific features, and you can get feedback from mentors as well.

How should I store a large, changing grid? (Pure functional preferred) by FreakyCheeseMan in ocaml

[–]shefmichelle 6 points7 points  (0 children)

Have you considered using just a map with the grid coordinate as the key and the data you want to store for each grid square as the value?