Skip to content

Allow prefixes to be replaced, not just removed #19

Closed
@ian-ross

Description

@ian-ross

Bug imported from C2HS Trac

Trac ticket created: 2009-06-26T19:43:28-0700


Given an enumeration such as:

enum {
ENUMPFXSYS_NOTHING,
ENUMPFXSYS_FOO,
ENUMPFXSYS_BAR
} WeirdEnum;

The weird prefix makes typing the Haskell type constructors a pain. It's currently possible to remove the prefix entirely. However, this can cause conflicts with existing Haskell types (such as the "nothing" case above). It would be nice if the prefix could be replaced, not just removed.

Something like:

{#enum WeirdEnum as Weird with prefix = ENUMPFXSYS_ add prefix = Weird #}

which would generate the following Haskell code:

data Weird = WeirdNothing | WeirdFoo | WeirdBar

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions