Skip to content

Improve deriving error messages

Instead of

    No instance for (Eq (Int -> Bool))
      arising from the 'deriving' clause of a data type declaration
    Possible fix:
      add an instance declaration for (Eq (Int -> Bool))
      or use a standalone 'deriving instance' declaration,
           so you can specify the instance context yourself
    When deriving the instance for (Eq Foo)

for

data Foo = Foo Int (Int -> Bool, Bool) deriving Eq

we want something like

    No instance for (Eq (Int -> Bool))
      arising from the second field of the constructor Foo
    Possible fix:
      add an instance declaration for (Eq (Int -> Bool))
      or use a standalone 'deriving instance' declaration,
           so you can specify the instance context yourself
    When deriving the instance for (Eq Foo)

where we tell the user more precisely from where in its data type the problem comes from. Should be possible by beefing up CtOrigin.

Trac metadata
Trac field Value
Version
Type FeatureRequest
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information