tryAll (runST (return (error "BANG!")))
will return (Right (error "BANG!")), because return isn't strict.
Nope,
main = tryAll (runST (return (error "BANG!"::( = print
yields `Left "BANG!"'!
but
main = tryAll (runST (
return ((error "BANG!",
I'm not quite sure, whether this is a bug at all, so maybe someone can
explain this behaviour to me:
Consider the following piece of code:
\begin{code}
import Exception
foo = do
res - tryAll (someObscureComputationThatThrowsErrors)
putStr "This is immediately printed: "
On Mon, May 08, 2000 at 07:30:18 -0700, Simon Marlow wrote:
If you embed the (error "BANG") inside a data structure, then it can indeed
excape from the tryAll because seq only evaluates to WHNF.
Thanks a bunch, that pointed me in the right direction!
tryAll (runST (return (error