Yet Another Monad Tutorial (part 2: >>= and return)

Jul 25, 2010 19:08


In the previous article I gave the conceptual background necessary to understand what monads are. Now I'm going to get into more of the details.
Read more )

Leave a comment

Comments 6

anonymous September 18 2010, 15:27:37 UTC
Spelling error.
"we'd write this (using Maybe as our example instnace):"

"putStrLn "unpacks" that line of text from the monadic value, prints it back to the terminal, "
Doesn't >>= unpacks the value

"what the >>= operator is doing is taking that string (called s here) and printing it."
Isn't putStrLn doing the printing?

-Lakshmi Narasimhan

Reply

Thanks! mvanier September 19 2010, 04:23:11 UTC
Good catch! I'll fix it momentarily.

Reply


good tutorial anonymous March 19 2011, 13:24:00 UTC
Thanks for this very comprehensive tutorial. I have absolutely no experience with Haskell, but have read something about Monads, which I did not understand (in "Beautiful Code", btw, a great book). Now it makes perfect sense.

I think the topic cannot be explained much better, assuming only some programming experience and the tiniest bit of understanding of functional programming.

Reply

Re: good tutorial mvanier March 20 2011, 02:40:17 UTC
Thank you very much!

Reply


Thanks anonymous June 12 2011, 17:38:31 UTC
Great article! Thanks you. Greetings from Poland

Reply

Re: Thanks mvanier June 13 2011, 03:42:31 UTC
You're welcome!

Reply


Leave a comment

Up