
18 Jul
2009
18 Jul
'09
4:42 a.m.
Conor,
I'm scared. What about this?
data EQ :: * -> * -> * where Refl :: EQ x x
class Public x where blah :: EQ x Fred
instance Public Fred where blah = Refl
What happens when I say
newtype Jim = Hide Fred deriving Public
? I tried it. I get
blah :: EQ Jim Fred
It's clear that GeneralizedNewtypeDeriving goes too far.
Now, I am scared. This should be regarded as a bug in generalised newtype deriving, shouldn't it? I would expect newtype deriving to be unable to come up with instances that cannot be written by hand. I would have expected people out on the streets marching to GHC headquarters by now; how can you stay so calm? Cheers, Stefan