Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m coming from Linux and Ruby. I\'ve been interested in learning more function

ID: 642236 • Letter: I

Question

I'm coming from Linux and Ruby. I've been interested in learning more functional programming, and in particular the ML-ish style. I've tried reading through the Real World Haskell book and trying some Haskell that way. But it's hard to learn this way for me because Haskell is very weird to me and I don't think I'll manage to really learn it until I try to do something real with it.

That's why I'm considering learning F# instead, because I'm guessing that this way I can kill two birds with one stone: learn an ML-style functional language paradigm, and also learn Windows programming APIs (.NET libraries). This seems to be a more productive route than learning the Haskell library counterparts of all the Ruby libraries I've grown to love, but staying within the Linux/OSX universe.

My question is, how sound is this reasoning? Is F# an adequate substitute for Haskell if you want to learn the programming ideas and techniques that Haskell teaches you?

Explanation / Answer

The biggest conceptual leap in Haskell compared to other languages are that it is pure and non-strict (lazy) and the monads and arrows abstractions that are used to implement inherently sequential operations in that world.

F# is neither. You can learn to work with higher order functions and common functional abstractions like map and reduce there, but all those things are available in ruby and python as well. And the advanced stuff is unique to Haskell.

Also F# uses .Net as it's standard library and that was designed for procedural languages (and it's not outstanding anyway; there are better frameworks out there), so you will quite likely find you are not actually writing much functional code anyway. From this point of view if you want to learn functional programming but don't feel ready for the big jump to Haskell, OCaml or one of the classics, Common Lisp or Scheme are preferable.

On a side-note, F# can be used on Unix as well with Mono, but on the other hand Ruby, OCaml or Haskell can be equally well used on Windows.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote