because Hindley-Milner rocks
I’ve been reading about ways in which Haskell and even OCaml do “ad Hoc” polymorphism without really understanding deeply the implications. (I still don’t but I’m a little closer.) Read this and this at Haskell.org. I’ve looked at David’s “Why Scala?” posting, more specifically the paper linked therein. I’ve been meaning to finish this paper found on Lambda the Ultimate once I get the time. In short I’ve been doing a lot of reading. And while it’s all very interesting something was missing. You know, that last little bit.
Last Thursday at Boston Area Scala Enthusiasts something clicked. I mean the kind of thing where you have flash backs to what you’ve been reading and go “Oh my Gosh.” The entire drive home from the train station it all started to make sense. I wish I could link on this website the presentation and the demonstrated results with Scalaz. Here’s a link to an online posting going over the same sorts of things that night (by the presenter, I believe.) However, these things lack the examples of their application.
As I’ve said in the past, I learn best by example. You can fill me full of theory all you want but until I see just one example of the basics applied to a real problem I sometimes have trouble connecting all the dots. Once that first bolt of lightning strikes, however, theory is often all I need. Then I’ll just look at myself and say “It was obvious the whole time! Why didn’t I see it?” Dunno, flaw with how I learn.
I’ll try and put up some examples of what helped me so that perhaps they can help someone else.