Opened 9 years ago

Closed 9 years ago

Last modified 2 years ago

#3046 closed bug (duplicate)

Generalized newtype deriving with associated types

Reported by: LouisWasserman Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When I have a

    class Foo a where
	type Bar a
	foobar :: a -> Bar a


instance Foo Fooey ...


newtype Fooey2 = F2 (Fooey) deriving (Foo) 

I expect the automatically generated deriving to include

type Bar Fooey2 = Bar Fooey

but this is not the case: I cannot get an associated type from a newtype to resolve to anything. My guess is that the combination of -XTypeFamilies and -XGeneralizedNewtypeDeriving is rare enough that this may simply not have been thought of yet, but it's something I'd like to see fixed.

Attachments (1)

Funky.hs (327 bytes) - added by LouisWasserman 9 years ago.
A test example.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by LouisWasserman

Attachment: Funky.hs added

A test example.

comment:1 Changed 9 years ago by LouisWasserman

Resolution: duplicate
Status: newclosed

comment:2 Changed 8 years ago by pumpkin

(duplicate of #2850 in case you find this one first)

comment:3 Changed 2 years ago by rwbarton

Type of failure: None/Unknown

I don't think this is a duplicate of #2850, but I do think it is a duplicate of #8165.

comment:4 Changed 2 years ago by simonpj

Correct; #8165 is the relevant ticket, and has a good discussion string.


Note: See TracTickets for help on using tickets.