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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe