[Haskell-cafe] Cont, ContT and IO()

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Jul 4 02:42:02 EDT 2009

Hello Günther,

Saturday, July 4, 2009, 3:11:23 AM, you wrote:

> I've got an IO action, some file system IO, traversing one level only and
> iterating over files found. I wish to build in an "early" exit, ie. if an
> IO action in the loop encounters a particular value I want it to abort the
> loop.

just make an explicit loop:

process [] = return ()
process (file:files) = do x <- doit file
                          if x>0 then process files
                                 else return ()
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list