Skip to content

Possible improvement for InvalidNewtypeInstance #2879

@hdgarrood

Description

@hdgarrood

For example, the following code:

module Main where

class C a

data NotNewtype a = NotNewtype a
derive newtype instance c :: C (NotNewtype String)

produces

  Cannot derive newtype instance for

    Main.C (NotNewtype String)

  Make sure this is a newtype.

Perhaps it would be better to say something like this?


Error 1 of 1

  Cannot derive newtype instance for

    Main.C (NotNewtype String)

  since NotNewtype is not a newtype.

  Note: NotNewtype is defined in Main as:

    data NotNewtype a = NotNewtype a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions