Day 28: Haskell
For the second half of today’s in-flight double header, I spent an hour with Haskell, another functional programming language similar to ML (and by extension, OCaml). I didn’t have as much luck finding good resources for Haskell as I did with Erlang; I started with Learn Haskell in 10 Minutes, which worked about as advertised, and from there, dove straight into a PDF version of Real World Haskell, the classic book for learning the language. I was happy to see that the PDF copy omits the giant beetle from the cover, which is the only thing stopping me from buying a paper copy of the book.
The book is very well written, if somewhat verbose. It spends a lot of time explaining the rationalization behind the language features and contrasting them with those of other languages. I wasn’t able to get a version of fold together in the allotted time; it’s been my observation that strongly typed languages have a much steeper learning curve than weaker ones — contrast Clojure with Scheme, for example, or, just today, Erlang and Haskell. That said, Haskell’s type system looks fantastic, and the way it handles generic types makes total sense and seems to alleviate a lot of the difficulties I had with Scala and OCaml. When you declare a function, you can say, literally, this function takes an ‘a’ and a ‘b’ and returns a list of ‘[a]’, and the compiler will fill those variables in with actual type values at compile time.
Though I’m disappointed I wasn’t able to get further into the language, I have a good base to start from and a good resource with which to learn more. Working my way through this book is second on my list of follow-up activities, right after finishing The Little Schemer.