[Haskell-cafe] Using the ContT monads for early exits of IO ?

Tim Wawrzynczak inforichland at gmail.com
Thu Jun 10 15:09:24 EDT 2010


Actually, on second thought, Lennart is probably right.  Continuations are
probably overkill for this situation.
Since not wanting to continue is probably an 'erroneous condition,' you may
as well use Error.

Cheers,
 - Tim

2010/6/10 Lennart Augustsson <lennart at augustsson.net>

> I would not use the continuation monad just for early exit.  Sounds
> like the error monad to me.
>
> 2010/6/10 Günther Schmidt <gue.schmidt at web.de>:
> > Hi everyone,
> >
> > I'm about to write a rather lengthy piece of IO code. Depending on the
> > results of some of the IO actions I'd like the computation to stop right
> > there and then.
> >
> > Now I know in general how to write this but I'm wondering if this is one
> of
> > those occasions where I should make use of the Cont monad to make an
> early
> > exit.
> >
> > Günther
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100610/e0d55282/attachment.html


More information about the Haskell-Cafe mailing list