## Our Latest Discovery

Sep 24 2007   12:41PM GMT

Profile: GuyPardon

Ok, I admit it: calculus is now officially a decade in my past. Math, or “maths,” as the Brits put it, however, is very much in my present, considering the importance of algorithms to modern life. (For more on that, just review this thread on the growing public awareness of algorithms over on Slashdot.)

One mathematical concept that’s worth mastering is the monad. Monads, in the context of functional programming (as opposed to pure mathematics), are a useful way of expressing input/output (I/O) operations and changes in state without using language features that introduce side effects. Monads are useful in any situation where a programmer wants to carry out a purely functional computation while a related computation is performed externally. Monad also, by the way, was the codename for Window’s Powershell before it was launched, a nod to the use of monads in that highly functional scripting language.

Make sense?

If that explanation still doesn’t suffice to explain what a monad is, never fear: The Catsters have posted a series of videos on YouTube to help you master the concept!

` ``[kml_flashembed movie="http://youtube.com/v/9fohXBj2UEI" width="425" height="350" wmode="transparent" /]`

`[kml_flashembed movie="http://youtube.com/v/Si6_oG7ZdK4" width="425" height="350" wmode="transparent" /]`

Monads 3: The definition of algebras for monads. The example of monoids as algebras for the monoid monad.

`[kml_flashembed movie="http://youtube.com/v/eBQnysX7oLI" width="425" height="350" wmode="transparent" /]`

`[kml_flashembed movie="http://youtube.com/v/uYY5c1kkoIo" width="425" height="350" wmode="transparent" /]`
Monads 5: Morphisms between algebras and the category of algebras. A first look at the question of monadicity.

`[kml_flashembed movie="http://youtube.com/v/Cm-O_ZWEIGY" width="425" height="350" wmode="transparent" /]`
If, after viewing, you’re still a bit curious about monads and programming, try Noel Winstanley’s “What the hell are Monads?” MenTaLguY also explains monads in the context of Ruby, escaping the need to work with Haskell.

Hat tip goes to the n-Category Cafe for the discovery!