Skip to content

Derive Prim instances for generated datatypes #1285

@jorisdral

Description

@jorisdral

See https://hackage-content.haskell.org/package/primitive-0.9.1.0/docs/Data-Primitive-Types.html#t:Prim

For examples, we can derive Prim instances for newtypes around primitive C types, like CInt:

typedef int MyInt
newtype MyInt { un_MyInt :: CInt }
  deriving newtype Prim -- this deriving statement would be the new feature

The primitive package is already in the dependency stack too, by the way

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageRequires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions