Yet Another Monad Tutorial (part 3: The Monad Laws)

Jul 25, 2010 19:16


In the previous article I talked about the two fundamental monadic operations in the Monad type class: the bind operator (>>=) and the return function. In this article I'll complete the definition of the Monad type class and talk about monad laws.

Read more )

Leave a comment

Comments 4

Suggestion anonymous May 5 2011, 08:06:22 UTC
Sticking with the "repetition pedagogy", I would remind the reader of ">>=" being kind of a pipe "|" as in linux' shell, which I assume every reader knows. I personally had to recall this each time I read the symbol ">>=" since it's not a really intuitive symbol to me.

Reply

Re: Suggestion mvanier May 5 2011, 08:08:55 UTC
This is a good point and when I discuss this operator in class I mention Unix pipes. Since you've just mentioned it for me, you've saved me the trouble! ;-)

Reply


sovkista August 28 2022, 23:52:07 UTC
Hi!

-- Form 1.
-- mv :: m a
-- f :: a -> m b

mv >>= \x -> mf x

Maybe
mv >>= \x -> f x ?

I can't figure out why we have mf here,

Reply

Typo mvanier August 29 2022, 05:01:13 UTC
That was a typo, which I just fixed. Thanks!

Reply


Leave a comment

Up