c2hs icon indicating copy to clipboard operation
c2hs copied to clipboard

Is it possible to share type definitions between packages?

Open Magicloud opened this issue 6 years ago • 1 comments

My routine for one binding package is that, a Types.chs for all pointer hook, and some modules containing fun hooks and using Types via import hook.

But when I made another binding package using the same Types (so those two packages can work with each other), since I do not have Types.chs in the second package, I cannot use import hook. And thus, seems like, C2HS knows nothing about the types. And generates ccall-s with wrong signature, for example, IO (Ptr ()) instead of IO (Ptr MyType).

Magicloud avatar Jan 08 '19 06:01 Magicloud

I am manually copying .chi between packages. It works. But requires some manually maintain. I am afraid it would lose sync. Wondering if there is a better way.

Magicloud avatar Feb 09 '19 06:02 Magicloud