[Haskell] Monads vs. continuations

Gregory Woodhouse gregory.woodhouse at sbcglobal.net
Mon Oct 31 14:05:26 EST 2005


On Oct 31, 2005, at 3:02 AM, Cale Gibbard wrote:

> Perhaps you're referring to a monoid. Since you seem to have some
> familiarity with category theory, check out
> http://en.wikipedia.org/wiki/Monad_%28category_theory%29 for a formal
> definition of monads and some background. Translating between
> notation, μ = join and η = return in Haskell. The application of the
> functor T to functions is called fmap, or liftM, which should always
> be equivalent.
>
> The functor behind a monad is always an endofunctor, that is, from the
> category to itself. In this case, you'll be interested in the category
> of Haskell types and Haskell-definable functions between them.

This was actually quite helpful. If someone had told me that a monad  
was a functor in the first place, this would all have been much less  
mysterious. (BTW, I have indeed encountered adjoint functors, Hom and  
Tensor, in the context of algebraic topology, so the article did  
leave me with a bit more of a sense of having my feet on the ground.)

>
> For a much gentler description and one way in which monads relate to
> programming, check out
> http://www.haskell.org/hawiki/MonadsAsContainers which is an article
> that I wrote.
>

This is an excellent article! I found it extremely useful and lucid.  
To be sure, it's going to take a bit more time to let all these ideas  
sink in, but I liked the approach of focusing on fmap and join (>>=  
always seemed mysterious). Believe it or not, though I've read that  
lists are monads, this is perhaps the first time I've seen it spelled  
out just how.

===
Gregory Woodhouse
gregory.woodhouse at sbcglobal.net

"It is foolish to answer a question that
you do not understand."
--G. Polya ("How to Solve It")





More information about the Haskell mailing list