X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcDefaults.lhs;h=66064c0dd5c9869e046d48facbfb0a8c11d1f728;hb=032e31a4f05e6e8e560d113c73dca47c0c18df10;hp=01d7fb23ddc1d970b731383e64c823219460cfd8;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcDefaults.lhs b/compiler/typecheck/TcDefaults.lhs index 01d7fb2..66064c0 100644 --- a/compiler/typecheck/TcDefaults.lhs +++ b/compiler/typecheck/TcDefaults.lhs @@ -5,17 +5,15 @@ \section[TcDefaults]{Typechecking \tr{default} declarations} \begin{code} -{-# OPTIONS_GHC -w #-} +{-# OPTIONS -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module TcDefaults ( tcDefaults ) where -#include "HsVersions.h" - import HsSyn import Name import Class @@ -29,6 +27,7 @@ import DynFlags import SrcLoc import Maybe import Outputable +import FastString \end{code} \begin{code} @@ -50,7 +49,7 @@ tcDefaults [] -- defaultDefaultTys tcDefaults [L locn (DefaultDecl [])] - = returnM (Just []) -- Default declaration specifying no types + = return (Just []) -- Default declaration specifying no types tcDefaults [L locn (DefaultDecl mono_tys)] = setSrcSpan locn $ @@ -61,7 +60,7 @@ tcDefaults [L locn (DefaultDecl mono_tys)] ; let deflt_clss | ovl_str = [num_class, is_str_class] | otherwise = [num_class] - ; tau_tys <- mappM (tc_default_ty deflt_clss) mono_tys + ; tau_tys <- mapM (tc_default_ty deflt_clss) mono_tys ; return (Just tau_tys) } @@ -86,19 +85,19 @@ check_instance ty cls = do { (_, mb_res) <- tryTc (tcSimplifyDefault [mkClassPred cls [ty]]) ; return (isJust mb_res) } -defaultDeclCtxt = ptext SLIT("When checking the types in a default declaration") +defaultDeclCtxt = ptext (sLit "When checking the types in a default declaration") dupDefaultDeclErr (L _ (DefaultDecl _) : dup_things) - = hang (ptext SLIT("Multiple default declarations")) + = hang (ptext (sLit "Multiple default declarations")) 4 (vcat (map pp dup_things)) where - pp (L locn (DefaultDecl _)) = ptext SLIT("here was another default declaration") <+> ppr locn + pp (L locn (DefaultDecl _)) = ptext (sLit "here was another default declaration") <+> ppr locn 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) 4 (ppr ty) badDefaultTy ty deflt_clss - = hang (ptext SLIT("The default type") <+> quotes (ppr ty) <+> ptext SLIT("is not an instance of")) - 2 (foldr1 (\a b -> a <+> ptext SLIT("or") <+> b) (map (quotes. ppr) deflt_clss)) + = hang (ptext (sLit "The default type") <+> quotes (ppr ty) <+> ptext (sLit "is not an instance of")) + 2 (foldr1 (\a b -> a <+> ptext (sLit "or") <+> b) (map (quotes. ppr) deflt_clss)) \end{code}