I think you're asking whether POSIX types should
be given a type/synonym on the Haskell side. The
Posix library does define some of them, but not
all - e.g., size_t isn't.

I'm sure patches which extended that library so as
to have these would be welcomed by the GHC developers.

--sigbjorn

George Russell <[EMAIL PROTECTED]> writes:
> 
> For historical reasons (I suppose), the text in the Users Guide
> section 5.4 on calling foreign functions from C seems to assume that
> you only need C integers (represented by Int).  This means 
> it's not clear what to do if, for example, you need size_t.
> At the moment I suppose most people are still using computers
> which are basically 32 bit throughout, so at the moment this
> is something of a non-issue, but in the next few years
> I expect this to change, and I think the way GHC is tied to a 
> particular correspondence C types <-> Haskell types is dangerous.
> So what I suggest is that we have a new structure which
> contains type synonyms corresponding to the C numeric types
> (for example CInt, CInt#, CSizeT, CSizeT#, and so on).  Also
> the manual should be changed to encourage people writing new
> code to use CInt rather that Int as the type name for when 
> they want to call a C function expecting an Int.
> 

Reply via email to