Skip to content

Allow parametrized yet monomorphic data types in {#pointer ... #} #36

Closed
@ian-ross

Description

@ian-ross

Bug imported from C2HS Trac

Trac ticket created: 2011-01-26T12:46:00-0800


Hello.

Currently pointer declaration could only use non-parametrized types. But sometimes it's too restrictive. I think examples below are self-explanatory:

This is OK but pointer is untyped

{#pointer *OKA__Hit as OKA_Hit #}

This doesn't work although it's perfectly sound. On syntactic level it may require addition of parenthesis.

{#pointer *OKA__Hit as OKA_Hit -> Hit Chan () #}

./Event.chs:23: (column 42) [ERROR]  >>> Syntax error!
  The phrase `Chan' is not allowed here.

There is workaround with type synonyms but it's not very elegant.

type Typedef = Hit Chan ()
{#pointer *OKA__Hit as OKA_Hit -> Typedef #}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions