Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haddock comments on enum constructors #271

Open
gilgamec opened this issue Nov 23, 2021 · 0 comments
Open

Haddock comments on enum constructors #271

gilgamec opened this issue Nov 23, 2021 · 0 comments

Comments

@gilgamec
Copy link

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 enums?

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant