2010/6/10 Günther Schmidt <gue.schm...@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.

What's wrong with a mere if/else condition?

foo = do
  bar
  x <- mu
  case x of
    Bar -> return ()
    Mu -> do y <- zot
             case y of
               Zot -> return ()
               Foo -> gud

foo = do
 bar
 x <- mu
 y <- bar
 when (pred x y) $ do
    zot x

Continuations are risky for causing confusion of readers (and the
author herself), do you definitely need this?
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to