RE: ANN: H98 FFI Addendum 1.0, Release Candidate 10
Manuel M T Chakravarty <chak@cse.unsw.edu.au> writes:
-=- Changes since RC 9
* 6.2: All the types in CTypes must be newtypes that are exported abstractly.
This change makes things highly inconvenient in nhc98. A newtype can only be passed across the FFI in nhc98 if we have enough information to determine the original type that is being renamed. If Foreign.C.Types exports them abstractly, then currently we do not have that information, and so these types cannot be used at all!
I am not suggesting that the newtype constructors should necessarily be part of the API seen by the user, but the problem comes down to a known deficiency in nhc98's interface file conventions.
How about exporting them non-abstractly for nhc98 only, and adding a comment to explain why the workaround is necessary? Cheers, Simon
"Simon Marlow" <simonmar@microsoft.com> wrote,
Manuel M T Chakravarty <chak@cse.unsw.edu.au> writes:
-=- Changes since RC 9
* 6.2: All the types in CTypes must be newtypes that are exported abstractly.
This change makes things highly inconvenient in nhc98. A newtype can only be passed across the FFI in nhc98 if we have enough information to determine the original type that is being renamed. If Foreign.C.Types exports them abstractly, then currently we do not have that information, and so these types cannot be used at all!
I am not suggesting that the newtype constructors should necessarily be part of the API seen by the user, but the problem comes down to a known deficiency in nhc98's interface file conventions.
How about exporting them non-abstractly for nhc98 only, and adding a comment to explain why the workaround is necessary?
That's what I prefer, too. Manuel
* 6.2: All the types in CTypes must be newtypes that are exported abstractly.
How about exporting them non-abstractly for nhc98 only, and adding a comment to explain why the workaround is necessary?
That's what I prefer, too.
OK, that's what I've done. The spec can stand as it is. Regards, Malcolm
participants (3)
-
Malcolm Wallace -
Manuel M T Chakravarty -
Simon Marlow