
30 Oct
2010
30 Oct
'10
1:42 a.m.
On Oct 30, 2010, at 2:30 PM, Mark Spezzano wrote:
If you use the type with Maybe Int like so:
sequence [Just 1, Nothing, Just 2]
then the result is Nothing.
Whereas sequence [Just 1, Just 2, Just 3] gives
Just [1, 2, 3]
Try do x <- Just 1 y <- Nothing z <- Just 2 return [x,y,z] and do x <- Just 1 y <- Just 2 z <- Just 3 return [x,y,z] The results are the same as with your calls of `sequence`. It is >>= which makes the difference, not `sequence`. Sebastian