[Haskell-cafe] Suggestions For An Intro To Monads Talk.

Hans Aberg haberg-1 at telia.com
Wed Aug 4 18:17:27 EDT 2010


On 3 Aug 2010, at 23:51, aditya siram wrote:

> I am doing an "Intro To Monads" talk in September [1]. The audience  
> consists of experienced non-Haskell developers but they will be  
> familiar with basic functional concepts (closures, first-class  
> functions etc.).
>
> I am looking for suggestions on how to introduce the concept and its  
> implications. I'd also like to include a section on why monads exist  
> and why we don't really see them outside of Haskell.

Probably because one does not bother writing them out in the type  
system. I wrote on a C++ wrap for Guile, and they showed up when  
typing expressions, though C++ templates are too limited to make this  
efficiently.

The monad has a code lifting property. If one has code which has both  
non-monadic and monadic components, it can be lifted up to the monadic  
level without having iterates (can be taken away with the monad  
projection).

So if one has code which has both non-IO and IO components, it can be  
lifted to the becoming all IO. Since IO and other imperative  
structures are incompatible with the lazy evaluation default, the type  
system can be used to describe them using monads.

Then one can use syntactic sugar like "do" and >>= to make the code  
look like ordinary imperative code.



More information about the Haskell-Cafe mailing list