Re:I learned Haskell in just 15 years
by neonsunset on Monday June 17, 2024 @08:07AM
(#40704754)
F# uses .NET's generics, so the statement regarding List/Set is completely incorrect (in fact, all base collections are generic).
I think you misread their claim - they said that generic list/set would have to be classes, not modules (generic modules are a specific thing in OCaml and aren't the same as a module of generic classes).
F# has "generics" just like Python and PHP now "have types".
It's not a yes/no feature.
Re:I learned Haskell in just 15 years
by neonsunset on Monday June 17, 2024 @03:22PM
(#40709923)
Give F# a try. It has, and always had, true generics.
https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
> It's not a yes/no feature.
FTFM: It's not a true/false feature.
Re:I learned Haskell in just 15 years
by neonsunset on Tuesday June 18, 2024 @04:16AM
(#40715291)
Alright. Humor me, what is the issue with F# generics as compared to other languages with generics? Which implementation (that is productively useful) is a "true" one?
I don’t know much about F#, but last time I used it most of its standard library was in C# and .NET, so F# code would interact with objects and classes a lot. AFAIK F# also doesn’t have functor modules, so even without the dependence on C# code, you still can’t avoid classes and objects like you can with OCaml (e.g. you can’t write a generic collection module like `List` or `Set` without functors, it would have to be a collection of a specific type or a class).