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

Günther Schmidt gue.schmidt at web.de
Fri Jul 3 19:11:23 EDT 2009


Hi,

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.

Now so far, pls don't shoot, I have done this by throwing IO Exceptions  
and catching them. I'm trying to rewrite this using Continuatios / callCC  
but can't figure out where to place what.

I certainly don't have the intuition yet and funny enough not even in RWH  
I could find some Cont/ContT examples.

Would someone please draw me an example?

Günther



More information about the Haskell-Cafe mailing list