Compiling Prelude.hs or complete base to external core
Carlos Lopez Camey
c.lopez at kmels.net
Mon Mar 25 15:16:30 CET 2013
Hi, I have an interpreter for external core and I would like to read the
definitions in base:Prelude. After jumping over some obstacles [0], I
find myself here:
> ghc --make -fext-core -I./include -cpp Prelude.hs
GHC/Num.lhs:65:27:
Could not deduce (base:GHC.Num.Num a) arising from the literal `0'
from the context (Num a)
bound by the class declaration for `Num'
at GHC/Num.lhs:(42,1)-(65,31)
Possible fix:
add (base:GHC.Num.Num a) to the context of
the class declaration for `Num'
In the first argument of `(-)', namely `0'
In the expression: 0 - x
In an equation for `negate': negate x = 0 - x
If I jump over this one with some nonsense fix (e.g. negate = id) then I get
GHC/Exception.lhs:47:14:
Cannot derive well-kinded instance of form `Typeable
* (SomeException ...)'
Class `Typeable' expects an argument of kind `k'
In the data declaration for `SomeException'
GHC/Exception.lhs:169:24:
Cannot derive well-kinded instance of form `Typeable
* (ErrorCall ...)'
Class `Typeable' expects an argument of kind `k'
In the newtype declaration for `ErrorCall'
GHC/Exception.lhs:186:22:
Cannot derive well-kinded instance of form `Typeable
* (ArithException ...)'
Class `Typeable' expects an argument of kind `k'
In the data declaration for `ArithException'
Do you have any tips that help me? I am using the HEAD version of base
and GHC 7.6.2.
I also tried base-4.6.0.0 but the file HsFFI.h is looked upon and is not
found or is not generated by ./configure (ieee-flpt.h: is a similar
case, although I could find this one on the web [1]).
[0] Manually compiled GHC/Event/{Poll,Clock,EPoll} with hsc2hs
[1] http://darcs.haskell.org/packages/base/include/ieee-flpt.h
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130325/4e282f26/attachment.htm>
More information about the ghc-devs
mailing list