
1 Aug
2005
1 Aug
'05
1:50 p.m.
"Dinh Tien Tuan Anh"
will be written without unsafePerformIO: co' (x:xs) = do c1 <- co' xs c<- f (x:xs) if (c==1) then return 1:c1 else return 0:c1
You might want to use unsafeInterleaveIO :: IO a -> IO a. It allows IO computation to be deferred lazily. In the particular example co' (x:xs) = do c1 <- unsafeInterleaveIO (co' xs) c <- f (x:xs) if (c==1) then return (1:c1) else return (0:c1) - Einar Karttunen