What is the proper way to write doc for bindings?

54 views Asked by At

While writing a Haskell binding for some libs written in C, a thing has to do is writing docs in haddock format. But since normally the binding is just plain, the doc would be just reformat of original libs' doc.

So my question is, is there some tools to help with this? Thanks.

1

There are 1 answers

1
chi On

I don't know of any tool for that. Since C docs can take many forms, I don't think there is any tool.

If the binding is indeed plain, essentially everything in IO, same names as the C library, etc. there is a very lazy option: provide a link to the C docs and refer to that.

Better: if the C docs are online, and each function/variable/entity has its own link, provide a link for each entity. In such way, the Haskell programmer can find your docs in Hackage, as usual, and then it's just one more click away to the real docs.

Of course, ideally one should copy the C docs, so that it's immediately available. However, this can require a lot of work, and some care in handling copyright correctly.