@Herbous: You are most welcome
These should have the same mechanism for capturing free variables from the enclosing scope as lambdas.
It seems so obvious to me, that object-oriented languages have closures for objects.
@Charles: They are the best indeed!
@ǃ: If you crave that kind of gourmet theory, have a look athttp://wwwhome.cs.utwente.nl/~fokkinga/index.html#detail_0000003413
@RichardAlan:perhaps watch the Haskell series first?
Fundamentalist functional programmers are really, really lazy. Even more that Ruby programmers, they actually take the DNRY motto to the extreme limit. Whenever they see a pattern repeating in their code, they try to encapsulate it in a reusable abstraction.
The interesting thing about Haskell and other advanced functional languages (http://en.wikipedia.org/wiki/Pure_type_system), is that you can also define abstractions over type constructors (not just over types as with generics in Eiffel, Java, C#, ...).
Once you can do that you suddenly discover design patterns, in the case of this lecture monads, that you did not see before: "Aha, this piece of code is has precisely the same structure as that,".
As with all cool concepts, in programming, it turns out that the mathematicians had long ago already discovered the same thing and called it "monads".
Other patterns that Ralf talks and will talk about are initial algebras, final co-algebras, homomorphisms (bananas, folds, lenses, unfolds, ..). Going even further, Ralf's hobby is to scrap *all* your boilerplate (http://research.microsoft.com/en-us/um/people/simonpj/papers/hmap/).
Another favorite hobby of fundamentalist functional programmers is to write programs in so-called "point-free" style, that is, using as few "variables" as possible (http://www.haskell.org/haskellwiki/Pointfree). Ralf might entertain and awe the audience with some Perls (pun intended) in this category in future lectures.
Anyway, this is just a long winded way of saying that all is going on is pattern matching. So don't despair, it is like thoseautosterograms, if you stare at it long enough, you will suddenly see it.
[Hey Channel 9, where is the spell checking in the comments?]
After this lecture *nobody* can claim anymore that Monads are difficult.
Sep 01, 2010 at 5:01PM
All young grasshoppers please remember "wax on, wax off, wax on, wax off, ..."