haskell / haskell/c2hs

Haddock comments on enum constructors

Open
#271 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
211
Forks
52
PR merge metrics
No merged PRs in 30d

Description

Haddock comments in `#fun` commands are passed on to the generated file, so that imported function arguments can be documented. Is it possible to do the same for imported `enum`s?

For example, if the C header file `foo.h` is
```
enum MyEnum{ FOO = 1, BAR = 2 };
```
and the CHS file is
```
#include "foo.h"

{# enum MyEnum
as MyEnum
{ FOO as Foo -- ^ foo
, BAR as Bar -- ^ bar
}
#}
```
then the generated hs file defines MyEnum as
```
data MyEnum = Foo
| Bar
```
The haddock comments have disappeared. Is it possible to maintain them during generation, so the generated file contains
```
data MyEnum = Foo -- ^ foo
| Bar -- ^ bar
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.