[Haskell] IO, exceptions and error handling

Tim Docker timothy.docker at macquarie.com
Mon Jun 14 12:50:39 EDT 2004


Keith Wansbrough wrote:

> s/fail/error/
> s/return//
> 
> Then you can easily write
> 
> > I can't (easily) write
> > 
> >     text c = sqr x + sqr (x+1)
> 
> You just can't *catch* this outside the IO monad.

Of course... that was my second alternative error
strategy. I'm interest in how/when people decide
when to throw exceptions versus when to thread
errors using monads, given that changing code
from one to the other could be quite a big deal.

Tim


More information about the Haskell mailing list