
On March 15, 2010 19:54:52 Iavor Diatchki wrote:
In terms of notation, I like the directness of the "static_wrapper" declaration (although not so much the "static_wrapper" name!) because it avoids duplication, thus reducing clutter and potential errors.
If it does get accepted, I would propose that adding a new closure form to the existing import and export forms might look a bit nicer. As in foreign closure ccall "cname" haskellname :: type gives you a C function (as you said) of the form result cname(arguments ..., HsStablePointer haskellname); This gets around the non-obviousness of an import also doing an export. If you didn't want to put the closure in the type, you could also support "first cname" and "last cname" (the default) versions to specify where the closure should be passed. Cheers! -Tyson