X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcDefaults.lhs;h=97d51a1fcd8f2663d3c34880f27746ac7d5c87a4;hb=2e5f521ad4b18128d55fdc1076237e9ee04e790b;hp=74a1769eae88e5916944debcfe004675ee810ce0;hpb=a3532ac90945bf7c540619f790649ddfbaaf6b2c;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcDefaults.lhs b/compiler/typecheck/TcDefaults.lhs index 74a1769..97d51a1 100644 --- a/compiler/typecheck/TcDefaults.lhs +++ b/compiler/typecheck/TcDefaults.lhs @@ -18,7 +18,7 @@ import TcType import PrelNames import DynFlags import SrcLoc -import Maybe +import Data.Maybe import Outputable import FastString \end{code} @@ -76,7 +76,7 @@ check_instance :: Type -> Class -> TcM Bool -- Check that ty is an instance of cls -- We only care about whether it worked or not; return a boolean check_instance ty cls - = do { (_, mb_res) <- tryTc (tcSimplifyDefault [mkClassPred cls [ty]]) + = do { (_, mb_res) <- tryTc (simplifyDefault [mkClassPred cls [ty]]) ; return (isJust mb_res) } defaultDeclCtxt :: SDoc @@ -85,14 +85,14 @@ defaultDeclCtxt = ptext (sLit "When checking the types in a default declaration" dupDefaultDeclErr :: [Located (DefaultDecl Name)] -> SDoc dupDefaultDeclErr (L _ (DefaultDecl _) : dup_things) = hang (ptext (sLit "Multiple default declarations")) - 4 (vcat (map pp dup_things)) + 2 (vcat (map pp dup_things)) where pp (L locn (DefaultDecl _)) = ptext (sLit "here was another default declaration") <+> ppr locn dupDefaultDeclErr [] = panic "dupDefaultDeclErr []" polyDefErr :: LHsType Name -> SDoc polyDefErr ty - = hang (ptext (sLit "Illegal polymorphic type in default declaration") <> colon) 4 (ppr ty) + = hang (ptext (sLit "Illegal polymorphic type in default declaration") <> colon) 2 (ppr ty) badDefaultTy :: Type -> [Class] -> SDoc badDefaultTy ty deflt_clss