haskell / c2hs

c2hs is a pre-processor for Haskell FFI bindings to C libraries
http://hackage.haskell.org/package/c2hs
Other
199 stars 50 forks source link

Maybe C2HS generated functions should not use "param omitting" style. #227

Open Magicloud opened 5 years ago

Magicloud commented 5 years ago

I am making a code generator that reads source and generating some wrappers. It worked fine with my own source. But failed with C2HS result since C2HS generated source uses param omitting.

For example, when I defined a Rect type with pointer hook, I would get a withRect function as withRect (Rect fptr) = C2HSImp.withForeignPtr fptr which omits the last param.

Since withRect is generated and not supposed to be read by human, I wonder why it was like this. Analyzing code and refill the parts seems really complex to me....