X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcClassDcl.lhs;h=87c18414ea3abc400c29e68c13d0be6b2d49c845;hb=36f77deda25312534200f10ccdb18528b6ee6e27;hp=92c7958d26c6fd975ce651b65469f9bf1377e82c;hpb=f4510d27c5883fe7e8570f4dd49d45a8b0122f2c;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcClassDcl.lhs b/compiler/typecheck/TcClassDcl.lhs index 92c7958..87c1841 100644 --- a/compiler/typecheck/TcClassDcl.lhs +++ b/compiler/typecheck/TcClassDcl.lhs @@ -727,15 +727,15 @@ mkGenericInstance clas (hs_ty, binds) tcAddDeclCtxt decl thing_inside = addErrCtxt ctxt thing_inside where - thing = case decl of - ClassDecl {} -> "class" - TySynonym {} -> "type synonym" - TyFunction {} -> "type function signature" - TyData {tcdND = NewType} -> "newtype" ++ maybeSig - TyData {tcdND = DataType} -> "data type" ++ maybeSig + thing | isClassDecl decl = "class" + | isTypeDecl decl = "type synonym" ++ maybeInst + | isDataDecl decl = if tcdND decl == NewType + then "newtype" ++ maybeInst + else "data type" ++ maybeInst + | isFamilyDecl decl = "family" - maybeSig | isKindSigDecl decl = " signature" - | otherwise = "" + maybeInst | isFamInstDecl decl = " family" + | otherwise = "" ctxt = hsep [ptext SLIT("In the"), text thing, ptext SLIT("declaration for"), quotes (ppr (tcdName decl))] @@ -767,7 +767,7 @@ badGenericInstance sel_id because notSimple inst_tys = vcat [ptext SLIT("because the instance type(s)"), nest 2 (ppr inst_tys), - ptext SLIT("is not a simple type of form (T a b c)")] + ptext SLIT("is not a simple type of form (T a1 ... an)")] notGeneric tycon = vcat [ptext SLIT("because the instance type constructor") <+> quotes (ppr tycon) <+>