FFI 1.0 in GHC

Manuel M. T. Chakravarty chak at cse.unsw.edu.au
Mon Feb 4 05:19:00 EST 2002


I have just committed the changes necessary to make GHC
conform to the FFI Addendum 1.0 to the CVS repo.  The old
style of foreign declarations is still supported, but causes
deprecation warnings.

I had to change one thing in the FFI Report.  I renamed the
`IOErrorType' inspection functions from `MarshalError' to

  alreadyExistsErrorType :: IOErrorType 
  doesNotExistErrorType  :: IOErrorType 
  alreadyInUseErrorType  :: IOErrorType 
  fullErrorType		 :: IOErrorType 
  eofErrorType	         :: IOErrorType 
  illegalOperationType   :: IOErrorType 
  permissionErrorType    :: IOErrorType 
  userErrorType		 :: IOErrorType 

The old proposal of using `userError' for the last function
clashed with the function of the same name in the
`Prelude'. 

I was wondering whether we should have functions
`isAlreadyExistsErrorType' etc, as otherwise, values of
`IOErrorType' need to be wrapped into an `IOError' before
they can be inspected with the standard routines from `IO'.
But this would just be a convenience, which I am not sure
whether it would really be needed much.  So, I haven't added
it.  Opinions?

Cheers,
Manuel





More information about the FFI mailing list