Marcin 'Qrczak' Kowalczyk mk167280 at
Mon Feb 5 05:27:28 EST 2001

On Mon, 5 Feb 2001, Simon Marlow wrote:

> I don't see that.  Presumably you mean overloading failIf with the Monad
> class, but `fail' takes a String and in the IO monad we want to raise a
> real IOError, not just a UserError.

MarshalError is a "portable" and language-independent error wrapping which
throws userErrors. This can easily be generalized to an arbitrary Monad.

CError translates errno to IOError. IOError's representation is private to
the Haskell's implementation. Translation of errors other than errno to
IOErrors would usually not make much sense anyway, and similarly
translation of errno to something other than throwing IOError.

Marcin 'Qrczak' Kowalczyk

More information about the FFI mailing list