Generating Function Prototypes

Manuel M. T. Chakravarty chak at
Wed Jul 3 21:04:57 EDT 2002

Alastair Reid <reid at> wrote,

> > I've been having trouble with an imported function that returns
> > Int64/"long long". Haskell doesn't generate a prototype, so regular
> > 'int' type is assumed.
> Which compiler is this for?  As you saw from the other replies,
> compilers vary in whether or not they add prototypes.  GHC: yes, NHC:
> no, Hugs: depends which day you grabbed your copy from CVS.
> (I'm not sure that the ffi should allow compilers to vary in this way
> but it does.)

The FFI doesn't really allow compilers to emit prototypes
(at least not in general) as this leads to semantic
differences eg in argument promotion, for which Section
4.1.5 precisely specifies the behaviour.

And GHC doesn't emit prototypes.

If you have any suggestions as to how to make this point
clearer in the spec, please let me know.


More information about the FFI mailing list