* Mark Spezzano [2010-10-30 15:37:30+1030]
> Can somebody please explain exactly how the monad functions "sequence"
> and "sequence_" are meant to work?
The others in this thread have already explained how these functions
work, so I'll just give an example how they are used.
Consider the followi
The expression
sequence [a,b,c,...]
is roughly equivalent to
do
r_a <- a
r_b <- b
r_c <- c
...
return [r_a,r_b,r_c,...]
The expression
sequence_ [a,b,c,...]
is roughly equivalent to
do
a
b
c
...
Hi,
Can somebody please explain exactly how the monad functions "sequence" and
"sequence_" are meant to work?
I have almost every Haskell textbook, but there's surprisingly little
information in them about the two functions.
From what I can gather, "sequence" and "sequence_" behave differently