Improved warning for redundant-constraints
Currently,
foo :: (Num a, Integral a) => a -> a
foo = id
produces the warning
Main.hs:1:1: warning: [-Wredundant-constraints]
• Redundant constraints: (Num a, Integral a)
• In the type signature for:
foo :: (Num a, Integral a) => a -> a
Since GHC can detect there is a redundancy, it would be nice it also told me which constraint was redundant. In #9939 (closed), I suggested that the warning include something to the effect of (Num a) is implied by (Integral a)
. Lets make this as easy for the user as possible.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |