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

TIMOTHY MICHAEL CARSTENS t.carstens at utah.edu
Tue Aug 3 19:04:08 EDT 2010


On Aug 3, 2010, at 4:44 PM, aditya siram wrote:

Thanks for reminding me. Although I wonder if there is a difference between drawing metaphors (monads are burritos etc.) and drawing parallels.

Since they are experienced developers, your audience will want to know how to use monads to solve problems they can already solve in other languages.  Drawing parallels is the quickest way to bootstrap this.

For example in the beginning it was useful for me to think of monads (and typeclasses really) as approximating Java interfaces. Now this parallel dies pretty quickly but it was something for me to hold onto while internalizing the concepts. Is there a danger in telling people this?

I believe you can draw such a parallel safely (I wrote an extended example of this [1] which received good feedback on ycombinator and bad feedback on reddit's r/haskell).  Use the familiar to bootstrap the idea, then generalize from there.  Certainly it would be bad to use such an example and not explain where it breaks down, but on the other hand, an example like this will get them on board much faster than "a monad is anything satisfying the following axioms..."

As you suggested at the beginning of the thread, they will wonder why they don't see monads in other languages.  I'm sure someone else has thought about this more than I have, but the absence of type classes and good syntactic support is likely the main culprit.

Depending on time allotted, you might not have a chance to include any good "killer examples" of why monads are valuable.  If you do have the time, though, I've found that people respond well to examples of parsec [2].

1. https://intoverflow.wordpress.com/2010/07/20/i-come-from-java-and-want-to-know-what-monads-are-in-haskell/
2. http://hackage.haskell.org/package/parsec-3.0.0


-deech

On Tue, Aug 3, 2010 at 5:36 PM, Dan Piponi <dpiponi at gmail.com<mailto:dpiponi at gmail.com>> wrote:
On Tue, Aug 3, 2010 at 2:51 PM, aditya siram <aditya.siram at gmail.com<mailto:aditya.siram at gmail.com>> wrote:
> I am doing an "Intro To Monads" talk in September [1].
> ...what would you stay away from.

Some things to stay away from:

http://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/

(Though I secretly harbour a belief that there is a correct metaphor
that everyone should be using. :-)
--
Dan

<ATT00001..txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100803/d9edef5c/attachment.html


More information about the Haskell-Cafe mailing list