architecture-dependent types

Manuel M T Chakravarty chak@cse.unsw.edu.au
Thu, 22 May 2003 00:14:13 +1000 (EST)


"Simon Marlow" <simonmar@microsoft.com> wrote,

> > Should not Foreign.C.Types, Foreign.C.TypesISO and System.Posix.Types
> > export their types opaquely?  That would make their interface and
> > documentation architecture-independent.
> 
> The FFI doesn't explicitly specify whether these types should be
> exported abstractly or not, but it does say in section 6.2:
> 
> "... all types exported by \code{CTypes} are
> represented as type synonyms or \code{newtype}s of basic foreign types
> ..."
> 
> we should really decide one way or the other, since this ambiguity will
> lead to non-portable differences between implementations of CTypes (and
> hence Foreign.C.Types).  

I wouldn't mind changing this to say that they must be
exported as abstract newtypes.  I think when we wrote the
quoted sentence, that feature that newtypes can be directly
passed to foreign functions was still new, which may have
contributed to the vague statement.

I'll change this if there are no objections.

Cheers,
Manuel