haskell / c2hs

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

Specify argument names with fun hooks? #163

Open robinp opened 8 years ago

robinp commented 8 years ago

Hello. Is it possible to tell the fun hook what name to use on the various generated arguments? Instead of just a1, a2 etc. Thanks!

RyanGlScott commented 8 years ago

Not that I'm aware of, no. Is there a particular reason why you'd need the arguments to have certain names? On Apr 18, 2016 2:12 PM, "Robin Palotai" notifications@github.com wrote:

Hello. Is it possible to tell the fun hook what name to use on the various generated arguments? Instead of just a1, a2 etc. Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/haskell/c2hs/issues/163

robinp commented 8 years ago

It would be nicer to read - for example, if there are three Bool arguments, would be nice to give descriptive names to them. Though I found you can put docstrings on the types, which alleviates the problem slightly.

One could argue that the wrapped functions are low-level and probably need a higher level wrapper with proper names - but still feel it would be useful to have descriptive names at the low level too.