« Return to Thread: Cont, ContT and IO()

Re: Cont, ContT and IO()

by Matthias Görgens-2 :: Rate this Message:

Reply to Author | View in Thread

> process [] = return ()
> process (file:files) = do x <- doit file
>                          if x>0 then process files
>                                 else return ()

Or use a fold:

> process' = foldl op True files
> op True file = doit file
> op False _ = False
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

 « Return to Thread: Cont, ContT and IO()