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

Alex Stangl alex at stangl.us
Fri Aug 6 11:58:40 EDT 2010


On Fri, Aug 06, 2010 at 10:17:26AM -0500, aditya siram wrote:
> >From my vantage point they are (in no particular order) : Reader, Writer,
> State, IO, ST, STM, Parsec (have I missed any?) and of course the
> transformer versions. I am debating whether or not to add [] to the bunch.

Not sure how much time you have budgeted, but I'd start with a simple
one like Maybe, actually show how to implement it, then move on to list,
and then finally talk about Reader, Writer, State, etc. from a more high
level perspective. Hopefully people would grok the monad concept by that
point, and should realize how useful it is to add logging, or state,
etc. Then they may wonder about mixing in more than 1, so that could
lead to transformers.


> To explain monads (now that I have Timothy's awesome blog post to reference)
> I'll be drawing the parallel between monads and interfaces in Java. And
> thanks to Tillman for showing me where the analogy breaks down. Are there
> any such parallels in other languages like Perl and Python?

I get the type class / Java interface analogy, but trying to draw a
parallel between Java interface and monads seems likely to just create
confusion IMHO.


> I'm still a little iffy on why the monad concept isn't used in other
> languages. From where I sit it seems as though monads really let you play
> with the order of evaluation - just because one statement is executed after
> another doesn't mean they are executed in that order. I think other
> languages don't make this easy.

I first encountered monads in OCaml. And the concept exists in other languages,
although maybe not always explicitly by that name.

Good luck, should be a good talk,

Alex


More information about the Haskell-Cafe mailing list