Malcolm Wallace wrote:
> > And a warning: The FFI specs do not guarantee that Float maps to
> > float, and likewise for the other Haskell types with names sounding
> > like the C types. It is the task of the upcoming module CTypes to
> > provide newtypes exactly for this task.
> 
> Eek, so was this the consensus on the FFI mailing list?

Yes.

> It seems rather horrible to me, but I imagine the rationale is
> that the primitive FFI should not be C-specific.

Not only that: You can't dictate that all implementations of Haskell
have to use e.g. int for Int. And I can't see what's horrible about
writing `CInt' instead of `Int', you only state clearly your intent
and don't rely on adventurous assumptions about the underlying
representation. And which Haskell types should one choose for size_t,
clock_t, time_t, ...? (Answer: CSize, CClock, CTime, ... :-)

> So is someone writing a JavaTypes module for release soon...?  :-)

Java is a slightly different story: At least the sizes for the basic
types are specified, so e.g. a Java int fits into an Int32.

Cheers,
   Sven
-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne

Reply via email to