X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcDeriv.lhs;h=0a8a4982326280d1a92550ff5b9b5b5e35c7cbca;hb=3e0b6b2542d8464bfba365b97a6e4b95c3885f10;hp=65c425d255d1c9522b34585dd3e0d658fdca6a31;hpb=45b391025ccd6f91d6c280c7d0e5e755b67e760c;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index 65c425d..0a8a498 100644 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -350,6 +350,10 @@ makeDerivEqns overlap_flag tycl_decls mk_eqn_help gla_exts new_or_data tycon deriv_tvs clas tys ------------------------------------------------------------------ + -- data/newtype T a = ... deriving( C t1 t2 ) + -- leads to a call to mk_eqn_help with + -- tycon = T, deriv_tvs = ftv(t1,t2), clas = C, tys = [t1,t2] + mk_eqn_help gla_exts DataType tycon deriv_tvs clas tys | Just err <- checkSideConditions gla_exts tycon deriv_tvs clas tys = bale_out (derivingThingErr clas tys tycon (tyConTyVars tycon) err) @@ -434,7 +438,7 @@ makeDerivEqns overlap_flag tycl_decls -- We must pass the superclasses; the newtype might be an instance -- of them in a different way than the representation type -- E.g. newtype Foo a = Foo a deriving( Show, Num, Eq ) - -- Then the Show instance is not done via isomprphism; it shows + -- Then the Show instance is not done via isomorphism; it shows -- Foo 3 as "Foo 3" -- The Num instance is derived via isomorphism, but the Show superclass -- dictionary must the Show instance for Foo, *not* the Show dictionary