Wed, 29 Mar 2000 15:00:46 +1000, Manuel M. T. Chakravarty <[EMAIL PROTECTED]> pisze:

> > 6) Add HsBool with a mapping to an arbitrary integral C type, see Fergus'
> >    point about a Haskell API. (Should we guarantee that False maps to 0 and
> >    True to something <>0?)
> 
> We don't make any guarantees for the mapping of Haskell _values_
> to C _values_ for any other type.

Of course we do. (HsInt)42 means 42 and nothing else.

enum HsBool {HsFalse, HsTrue};
/* Hs{False,True} guaranteed to be 0 and 1 */

> > 1) Add the following type synonyms to module FFI (if there is no
> >    corresponding Haskell type, the implementation should use the "closest"
> >    one):
> > 
> >    Haskell type |     C type
> >    -------------+-------------------
> >    CLLong       | long long
> >    CULLong      | unsigned long long
> >    CLDouble     | long double
> 
> Closest?  And do what if a marshalled value does not fit?

data CLDouble = CLD# Double# -- ugh, plain newtype won't work
if we transparently pass newtypes' contents through FFI :-o

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/              GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                  W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to