
2 May
2005
2 May
'05
3:32 p.m.
On Monday 02 May 2005 20:52, Lennart Augustsson wrote:
Benjamin Franksen wrote:
Another way to explain what sequence does is the following implementation, which I find a bit easier to understand for the beginner than the one given in http://www.haskell.org/onlinelibrary/standard-prelude.html :
sequence [] = [] sequence m:ms = do x <- m xs <- sequence ms return (x:xs)
Except that this definitions has a syntax error and a type error (or just a different type if you provide no signature).
Oh dammit, sorry. This is what I meant: sequence [] = return [] sequence (m:ms) = do x <- m xs <- sequence ms return (x:xs) Cheers, Ben