[Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

Günther Schmidt gue.schmidt at web.de
Sat Jul 4 10:54:13 EDT 2009


I've put the code that I wish to transform from using exceptions to using  
continuations on hpaste:




Am 04.07.2009, 01:11 Uhr, schrieb Günther Schmidt <gue.schmidt at web.de>:

> 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

Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

More information about the Haskell-Cafe mailing list