Classes have finished for the year, and I finally have some time to get real work done! One of the whole host of things I got involved with this semester was working on designing a new programming language with my friend Alex Marquez.
One of the major hurdles for me is that a new type system is core to the language, and that type system uses all sorts of techniques that I’m unfamiliar with. Type inference, pure functional style, reification, currying, kinds (type of types) and many other things I now vaguely understand with from talking about the language with Alex, but there’s certainly a long way to go.
So I decided to rectify that by giving a shot at Haskell, that crazy, purely functional language with monads and all sorts of interesting things. I’m working through a collection of resources now, and thought I’d collect them here for others to start from.
- The first is Real World Haskell (RWH), the O’Reilly book by Bryan O’Sullivan, John Goerzen, and Don Stewart.
- Next is Learn You A Haskell (LYAH), the quirky tutorial by Slovenian Miran Lipovača.
- I also found the Gentle Introduction to Haskell (GIH), by Paul Hudak, John Peterson, and Joseph Fasel to be useful as well.
- And for a great search engine of Haskell types and documentation, check out Hoogle.
Of the three tutorials, RWH is the most gentle. It also features a wonderfully innovative comment system, where user comments can be made on a paragraph by paragraph basis. Several times I found that a comment had a particularly useful addition or alternate explanation, which greatly added to the straight text. Reading RWH+Comments feels akin to being at a conference while following the backroom chatter on Twitter during a presentation. You’re given both the presentation and the critique, interwoven in time.
But at times, RWH felt a bit too slow at getting to the interesting stuff. I wandered around a bit and found myself at LYAH, which is the site I started learning Haskell from several months ago. With quirky drawings and a good pace, I switched over to using LYAH as my primary Haskell tutorial.
And by browsing around online (imagine…) I came across GIH, the most academic of the three. GIH does an excellent job of formally defining functions and concepts as you move forward, but it’s quite heavy. I found myself glancing at other resources to actually understand what was going on, and in several cases I only understood a piece of code because I’d learned something from another tutorial. I’d say that GIH is better for a later tutorial once you get the big picture of Haskell and are looking for more details. GIH goes into more depth on language constructs and has extensive links to the official Haskell definition and the code implementing the Prelude (standard library).
And a great resource shared with me by friend David Hollis is the search engine Hoogle. I’ve ended up using Hoogle mostly as a reminder of what functions do, not just what their type signature is. And searching by a type signature is something I’ve never seen before. Very cool!
Best of luck in learning Haskell!