6
$\begingroup$

I've been using Clojure for about 18 months. Recently, I've come across terms such as Monads, Continuations, et al which I'd like to learn about.

I could visit Wikipedia and read about these two topics, but I'm looking for a reference which also help me learn about related matters that I don't even know exist. Is there a book on this particular topic (if it even qualifies as one)? Would I pick these things up by learning about type systems or language design in general? Should I just learn Haskell to get exposure?

$\endgroup$
3
$\begingroup$

I would focus on learning a functional language in order to learn these. There's no need for it to be Haskell. It could be Scheme or ML, or even Coq or Agda. Frankly, Clojure will probably do. But to me, monads and continuations are only programming tools. They don't let you do any new computations, they just let you do them in a different way. So understanding them outside of the context of a particular style of programming to me doesn't make much sense.

I'd recommend Real World Haskell as an introduction to some of these concepts, particularly in how they can be used in programming. I'm not sure how much it has on continuations. I learned continuations from Essentials of Programming Languages, which I quite liked, but deals with Scheme rather than Haskell, and doesn't do anything monadically.

$\endgroup$
3
$\begingroup$

I agree with @jmite that the best resources on continuations are likely to come from the Scheme community. Here's a brief tutorial that looks very good: Jeremy H Brown, Advanced Scheme. The tutorial also discusses Scheme's hygienic macros which might also interest you since Clojure has a similarly powerful macro facility.

For monads I originally tried to learn from reading the Haskell community's research papers and gave up in despair. Eventually I found Simon Peyton Jones: "Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell", in Engineering theories of software construction, Hoare, Broy, Steinbruggen, ed., IOS Press, ISBN 1 58603 1724, 2001, pp47-96, which is somewhat better, but still written for an IQ higher than mine.

Finally I decided that a monad is the type an object that allows you to implicitly thread a state variable through a bunch of computations, and gave up caring. So today I googled "monad threaded through computations" and found this absolutely brilliant tutorial: Noel Winstanley, "What the hell are monads", 1999.

$\endgroup$
  • $\begingroup$ Phil Wadler's classic paper "Comprehending Monads" is also useful. The title is a typical Wadlerian pun, because it approaches monads from the point of view of list comprehensions. $\endgroup$ – Pseudonym Jul 24 '13 at 1:20
  • $\begingroup$ Thank you for "What the hell are monads?" - that is an awesome introduction to a very challenging idea! I'll second your "absolutely brilliant" comment. $\endgroup$ – D.W. Jul 24 '13 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.