Skip to content

derive newtype instance fails with recursive type #3407

@dbeacham

Description

@dbeacham

For example

newtype MyRec = MyRec { a :: Int, b :: Maybe MyRec }

derive newtype instance showMyRec :: Show MyRec

which gives me the errors:

The value of showMyRec is undefined here, so this reference is not allowed.

See https://github.com/purescript/documentation/blob/master/errors/CycleInDeclaration.md for more information,
or to contribute content related to this error.

Comment from @paf31 in #2975

This makes sense to me that that would not work, since there's no eta expansion happening (and I don't think there should be either).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions