Using error instead of fail results in an ErrorCall instead of
IOError to be emitted, which is subsequently not caught by wrapIOError
and thus escapes the MonadError machinery.
This means the user would need to have two layers of error handling in place,
which is probably not the intented behaviour.
Using
error
instead offail
results in anErrorCall
instead ofIOError
to be emitted, which is subsequently not caught bywrapIOError
and thus escapes theMonadError
machinery.This means the user would need to have two layers of error handling in place, which is probably not the intented behaviour.