Skip to content

Problem deriving instances

I have the following (reduced to the bare neccessities to produce the error) piece of code:

----
newtype A a = A a
    deriving (Eq,Show)

type B = A

type C = B D
--type C = A D
type D = Double

data E = E { a :: C }
    deriving (Eq,Show)
----

Compiling with ghc gives me the following error:
test.hs:13:
    No instance for `Eq C'
    When deriving classes for `E'

When I change the type of C to what I commented out (eg A D instead of B D) it works fine.

I don't think this is an error on my side, and besides hugs loads it without a complaint.
Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component Compiler
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