17 thoughts
last posted Feb. 21, 2014, 6:53 p.m.

10 earlier thoughts

0

I've taken a little break from writing about Haskell, since I've been so deeply involved in Python for my day job.

Still, my reading hasn't slowed down. I've come to adore LYAH. Now that I have a much better understanding of monads and how Haskell solves problems, it's been much easier to digest the book. All of the first 12 chapters make a lot of sense to me, and it was fun being excited about the power of Applicatives. My favorite example so far has been the instance of Applicative for []. It leads to an expansion on all possible outcomes, which is awesome:

haskell (++) <\$> ["ha","heh","hmm"] <*> ["?","!","."] ["ha?","ha!","ha.","heh?","heh!","heh.","hmm?","hmm!","hmm."]

All it took was three lines to define the Applicative instance for [], too!

haskell instance Applicative [] where pure x = [x] fs <*> xs = [f x | f <- fs, x <- xs]

I love that! The whole thinking behind typeclasses is very appealing to me.

Oh, which reminds me - the History of Haskell paper, though a bit long (55 pages, 2-columns), has been exactly what I've been looking for. It explains how all the features in Haskell, including various extensions, came to be, and what problem they solved. I highly recommend this paper if you're early in your Haskell education.

I've yet to make the time to write something in Haskell, but my learning and excitement hasn't come to a stop.

6 later thoughts