[Haskell-cafe] does try force evaluation of IO value

s9gf4ult at gmail.com s9gf4ult at gmail.com
Fri Oct 5 12:52:52 CEST 2012

> No, it won't force the return value. To do that, use evaluate
> http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exc
> eption-Base.html#g:7
But what is happening when exception is raised when consuming value from 
result of "try" ?
try has signature
try :: Exception e => IO a -> IO (Either e a)
so it must return either exception value either evaluated value and must not 
raise exceptions, but how can "try" return (Right a) wthout making sure that 
action will not raise any exception ?

More information about the Haskell-Cafe mailing list