cvs commit: nhc98/src/prelude/FFI CTypes.h CTypes.hs CTypesExtra.hs

panne 2004/06/14 11:02:26 PDT Modified files: src/prelude/FFI CTypes.h CTypes.hs CTypesExtra.hs Log: * s/NUMERIC_TYPE/ARITHMETIC_TYPE/ * ARITHMETIC_TYPEs now have a Real instance (should probably be tracked in some magic .hi files => Malcolm?) * Reverted most of my attempt to make CTypes* conform to the FFI spec: I can't manage to compile any Bit instances at this stage, neither Data.Bits nor NHC.SizedTypes is available. There must be some way to teach this to nhc98 by hand first => Malcolm? Revision Changes Path 1.3 +8 -11 nhc98/src/prelude/FFI/CTypes.h 1.7 +2 -2 nhc98/src/prelude/FFI/CTypes.hs 1.5 +4 -4 nhc98/src/prelude/FFI/CTypesExtra.hs

Sven Panne
Modified files: src/prelude/FFI CTypes.h CTypes.hs CTypesExtra.hs Log: * s/NUMERIC_TYPE/ARITHMETIC_TYPE/
* ARITHMETIC_TYPEs now have a Real instance (should probably be tracked in some magic .hi files => Malcolm?)
The Real instances were already present by virtue of INTEGRAL_TYPE, so no change required there. However, now that CClock and CTime have become mere ARITHMETIC_TYPE, they seem to have lost their previous instances of Bounded and Integral. Is this correct?
* Reverted most of my attempt to make CTypes* conform to the FFI spec: I can't manage to compile any Bit instances at this stage, neither Data.Bits nor NHC.SizedTypes is available. There must be some way to teach this to nhc98 by hand first => Malcolm?
I'll think about it. Possibly all of nhc98's FFI libraries need to move into a separate package, so they can depend on package base. Regards, Malcolm

* Reverted most of my attempt to make CTypes* conform to the FFI spec: I can't manage to compile any Bit instances at this stage, neither Data.Bits nor NHC.SizedTypes is available. There must be some way to teach this to nhc98 by hand first => Malcolm?
I'll think about it. Possibly all of nhc98's FFI libraries need to move into a separate package, so they can depend on package base.
Actually, the simplest way to do it is to add the instances of Data.Bits.Bits directly to Foreign.C.Types, which I have now done. Regards, Malcolm

Malcolm Wallace wrote:
However, now that CClock and CTime have become mere ARITHMETIC_TYPE, they seem to have lost their previous instances of Bounded and Integral. Is this correct? [...]
That's exactly what is intended by the change. C99's arithmetic types are either integral *or* floating types. Assuming Bounded/Integral for them is wrong. Cheers, S.
participants (3)
-
Malcolm Wallace
-
Sven Panne
-
Sven Panne