|
It's strange how appealing F# becomes once you realize you have the full power of the Visual Studio debugger and the .NET libraries. To someone who has mostly worked with Haskell (w.r.t. functional languages), that sounds great. Good debugging is absolutely essential - though with strongly typed functional languages, it's not often that necessary. But it's nice. Then again, it's a very liberal language, if the end of the spectrum is Haskell. It allows side effects and mutable variables. While very convenient, nothing forces you to use these though. There are immutable data structures for everything. But it seems there are all the functional tools you'd want. It's not Haskell, it's not pure and beautiful like it, but you still have computational expressions, which allow you to implement monads; metaprogramming, operator overloading, units of measure, and active patterns. My only gripe is that the compiler doesn't translate functions that can return null to return an option value (i.e. Maybes), and null values in general! Would make interfacing the .NET library much cleaner. Right now I have to do something silly like this: let notNull a = if a <> null then Some a else None
So I have to pipe every function call that may return null to this function when I'm in the Maybe monad, which is frankly a bit bothersome.Still. Even being able to use the Maybe monad when working with .NET is really cool. |
Like the majority of ML languages. Haskell is pretty special here, being the descendant of Miranda.
Personally I think ML languages of OCaml branch are better for the general programmer public, as the entry level is a lower.