[jhc] jhc and c2hs usecase (issue)

John Meacham john at repetae.net
Tue Aug 24 12:24:04 EDT 2010


On Tue, Aug 24, 2010 at 11:09:45AM +0200, Csaba Hruska wrote:
> I'm currently working on an improved version of bullet physics engine
> binding. (the binding code is generated by a python script according c++
> api. it uses c2hs too)
> I'd like to support jhc too.
> The attached code compiles with ghc (ghc --make testBullet.hs) but fails
> with jhc 0.7.6-3.
> Here is the error message:
> 
> *Typechecking...*
> *[1 of 4] BulletTypes      (.............................................)*
> *[2 of 4] C2HS             (.............................................)*
> *[3 of 4] BulletMod        (......jhc: user error (*
> *What:    failure*
> *Why:     context reduction, no instance for: Jhc.Float.RealFloat
> Foreign.C.Types.CFloat*
> *Where:   on line 7114 in ./BulletMod.hs*
> *in the explicitly typed BulletMod.btConcaveShape_setMargin
> BulletMod.5833_a1*
> *  BulletMod.5834_a2*
> *  = BulletMod.withBt BulletMod.5833_a1 Jhc.Basics.$*
> *      \ BulletMod.5835_a1' ->*
> *        let BulletMod.5836_a2' = C2HS.cFloatConv BulletMod.5834_a2 in*
> *          BulletMod.btConcaveShape_setMargin'_ BulletMod.5835_a1'*
> *            BulletMod.5836_a2'*
> *            Jhc.Monad.>>=*
> *            \ BulletMod.5837_res -> Jhc.Monad.return (Jhc.Basics.())** **{-
> on line 7114 -}*
> *Compilation of module: BulletMod)*
> 
> 
> Is this my fault or is it a jhc problem?

It's a jhc problem. :) A fairly straightforward one actually, I just
never got around to filling out all the instances for the
Foreign.C.Types types so it is just a library issue. Thanks for
reporting it!

    John


-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the jhc mailing list