Fergus Henderson wrote:
[many interesting things which are snipped]
> There are many common examples where exceptions arise for reasons other
> than I/O, for example integer overflow, division by zero, taking the
> square root of a negative number, head of an empty list, and so forth.
When that happens in my code it counts as a bug!  Therefore error is
appropriate.  If you are in some larger Haskell universe calling component
Haskell code it is unfortunate if a single error calls the entire universe
to collapse, so you do need some way of recovering, but perhaps a function
as mentioned of type
   a -> IO (Maybe a)
which traps the error might suffice for this case.



Reply via email to