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 "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!", 42) :: (Int,Int))
)) >>= print
leads to an error (for the reason you mentioned).
Maybe someone can add a note about this gotcha in the docs
(sec-exception.html#3.8.3)?
Cheers,
Michael
--
Don't worry, honey, just two more lemmas ...