[Haskell-cafe] Monad Description For Imperative Programmer
david48
dav.vire+haskell at gmail.com
Wed Aug 1 09:15:47 EDT 2007
On 8/1/07, Andrew Wagner <wagner.andrew at gmail.com> wrote:
> This seems wrong to me. A monad is, first and foremost, a type
> constructor class. I'm not sure how you can really compare that to a
> loop. But perhaps the easiest way to test your definition would be to
> ask this: How is, for example, the Maybe monad like a loop, in your
> definition?
As a beginner haskeller coming from an imperative experience, I think
I understood what he meant.
say you have this code :
putStrLn "1" >> putStrLn "2" >> putStrLn "3"
you can imagine each of the calls to putStrLn gets implicitly passed a
variable (here, the world ) and they happen in succession so it's
"like a loop".
Except that a loop... loops so the comparison is far fetched.
More information about the Haskell-Cafe
mailing list