Since I wrote about F# in August, my progress has been rather slow.
There was a lot of work to do for Uni, almost all involving final touches to Pavel, the data-analysis tool me and a few other students have developed as a student research project. We’ll publish Pavel next week on SourceForge, I’ll write a few lines about it then.
Another thing that has held me back is my fascination for Haskell. I have read enough of Jason Hickeys Introduction to the Objective Caml Programming Language to see lots of charming similarities between the two languages, and I’m really starting to like OCaml/F#, I’m looking forward to finally writing soemthing useful in it, but Haskell’s purity and late-binding are still captivating, somehow, making me peek over to the world of Haskell from time to time.
That slumbering interest once gain came back to live when I stumbled upon XMonad and then, via their press-page, upon Simon Peyton-Jones’ (author of GHC, a bright, funny guy) OSCON 2007 Presentation A Taste of haskell (Part 1 and 2).
The week after watching the presentation, I was looking for understandable explanations of monads again. What I’m always looking out for is a tutorial that treats them not in their entire category-theory-context, and neither in terms of plain haskell. I haven’t found anything like that so far but several Haskell-based approaches that are written for beginners of Haskell (in contrast to the many written for people with haskell experience) were quite helpful.
The first was Meet Bob the monadic lover. It starts out lighthearted and funny but the examples get increasingly convoluted and artificial the closer the text comes to the topic of monads.
Next was A Schemer’s Introduction to Monads which tries to explain them using CPS. I merely glanced over it since I’m not a Schemer and I had some tutorials that looked more promising:
In Everything Your Professor failed to Tell You About Functional Programming Shannon Behrens writes
At this point, the reader may be begging for some code. One of the hardest things about learning Haskell is you can’t understand Haskell without understanding monads, and you can’t understand most of the monad examples without understanding Haskell.
(yes!) and gives a glimpse of the monad concept by implementing a monad in Python and Javascript.
Behrens text not being quite enough to fit the concept into my head, MenTaLguY’s Monads in Ruby Tutorial went a little further by implementing a basic monad using Ruby (which I’m far more familiar with than Python or JS, whose syntax also doesn’t get in the way of expressing the essential parts of the monad pattern).
Unfortunately Monads in Ruby was written in 2005 and never quite finished.
Monads as Containers picks up where Monads in Ruby leaves, with in examples in Haskell again. I haven’t read far enough to actually comment on it though.
A few classics on the topic might come in handy once I’ve worked through Monads as Containers: Noel Winstanley’s What the hell are monads? and Jeff Newbern’s All about monads.
I’m not hardcore enough (yet) to tackle http://en.wikibooks.org/wiki/Haskell/Category_theory or Eugenia Cheng’s Tutorial Videos on Monads (blackboard lecture at breakneck speed), both more from a mathematical point of view.
Phew, I was about to write about F# originally.
Although my progress through the tutorial is a little slow, it is very well written and so far I didn’t encounter any hard parts. Besides that the only noticable thing was a discussion on the F# Mailing list about (automatic) parallelization of F# Code. Bottom line: automatic generation of parallel code is not possible at the moment due to the unpure nature of OCaml/F#. There exist certain tools however, to help with the manual specification of parallel computations, like the Task Parallel Library.