5 Nov
2001
5 Nov
'01
10:23 p.m.
Is there any way, short of using unsafePerformIO, to implement a combinator f :: [IO a] -> IO [a] in a way that the the result is produced lazily? The problem with sequence :: (Monad m) => [m a] -> m [a] sequence = foldr (liftM2 (:)) (return []) where liftM2 f a b = do { a' <- a; b' <- b; return (f a' b') } is that it consumes the entire input before producing a result. Thanks for any advice, --Joe English jenglish@flightlab.com