Boot file instances should imply superclasses
Currently, if I write the following program:
-- A.hs-boot
module A where
data T
instance Ord T
-- B.hs
module B where
import {-# SOURCE #-} A
f :: T -> T -> Bool
f x y = x == y
I get:
B.hs:4:11:
No instance for (Eq T) arising from a use of `=='
Possible fix: add an instance declaration for (Eq T)
In the expression: x == y
In an equation for `f': f x y = x == y
This is a bit confusing, because Ord instances are supposed to imply Eq instances.
GHC should either:
- Reject A.hs-boot (claiming that it could not find evidence that T had an Eq instance), or
- Accept B.hs, since the instance requirement for Ord should imply Eq.
Trac metadata
Trac field | Value |
---|---|
Version | 7.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | low |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |