Trim redundant import
[ghc-hetmet.git] / compiler / rename / RnTypes.lhs
index 0e58a59..0e047fe 100644 (file)
@@ -130,7 +130,7 @@ rnHsType _ (HsNumTy i)
   | i == 1    = return (HsNumTy i)
   | otherwise = addErr err_msg >> return (HsNumTy i)
   where
-    err_msg = ptext SLIT("Only unit numeric type pattern is valid")
+    err_msg = ptext (sLit "Only unit numeric type pattern is valid")
                           
 
 rnHsType doc (HsFunTy ty1 ty2) = do
@@ -170,9 +170,8 @@ rnHsType doc (HsPredTy pred) = do
     pred' <- rnPred doc pred
     return (HsPredTy pred')
 
-rnHsType _ (HsSpliceTy _) = do
-    addErr (ptext SLIT("Type splices are not yet implemented"))
-    failM
+rnHsType _ (HsSpliceTy _) =
+    failWith (ptext (sLit "Type splices are not yet implemented"))
 
 rnHsType doc (HsDocTy ty haddock_doc) = do
     ty' <- rnLHsType doc ty
@@ -490,7 +489,7 @@ checkSectionPrec direction section op arg
          checkErr (op_prec < arg_prec
                     || op_prec == arg_prec && direction == assoc)
                  (sectionPrecErr (ppr_op op_name, op_fix)      
-                 (pp_arg_op, arg_fix) section)
+                                 (pp_arg_op, arg_fix) section)
 \end{code}
 
 Precedence-related error messages
@@ -498,19 +497,19 @@ Precedence-related error messages
 \begin{code}
 precParseErr :: (SDoc, Fixity) -> (SDoc, Fixity) -> SDoc
 precParseErr op1 op2 
-  = hang (ptext SLIT("precedence parsing error"))
-      4 (hsep [ptext SLIT("cannot mix"), ppr_opfix op1, ptext SLIT("and"), 
+  = hang (ptext (sLit "precedence parsing error"))
+      4 (hsep [ptext (sLit "cannot mix"), ppr_opfix op1, ptext (sLit "and"), 
               ppr_opfix op2,
-              ptext SLIT("in the same infix expression")])
+              ptext (sLit "in the same infix expression")])
 
 sectionPrecErr :: (SDoc, Fixity) -> (SDoc, Fixity) -> HsExpr RdrName -> SDoc
 sectionPrecErr op arg_op section
- = vcat [ptext SLIT("The operator") <+> ppr_opfix op <+> ptext SLIT("of a section"),
-        nest 4 (ptext SLIT("must have lower precedence than the operand") <+> ppr_opfix arg_op),
-        nest 4 (ptext SLIT("in the section:") <+> quotes (ppr section))]
+ = vcat [ptext (sLit "The operator") <+> ppr_opfix op <+> ptext (sLit "of a section"),
+        nest 4 (ptext (sLit "must have lower precedence than the operand") <+> ppr_opfix arg_op),
+        nest 4 (ptext (sLit "in the section:") <+> quotes (ppr section))]
 
 pp_prefix_minus :: SDoc
-pp_prefix_minus = ptext SLIT("prefix `-'")
+pp_prefix_minus = ptext (sLit "prefix `-'")
 ppr_op :: Outputable a => a -> SDoc
 ppr_op op = quotes (ppr op)    -- Here, op can be a Name or a (Var n), where n is a Name
 ppr_opfix :: (SDoc, Fixity) -> SDoc
@@ -528,20 +527,20 @@ forAllWarn :: SDoc -> LHsType RdrName -> Located RdrName
            -> TcRnIf TcGblEnv TcLclEnv ()
 forAllWarn doc ty (L loc tyvar)
   = ifOptM Opt_WarnUnusedMatches       $
-    addWarnAt loc (sep [ptext SLIT("The universally quantified type variable") <+> quotes (ppr tyvar),
-                       nest 4 (ptext SLIT("does not appear in the type") <+> quotes (ppr ty))]
+    addWarnAt loc (sep [ptext (sLit "The universally quantified type variable") <+> quotes (ppr tyvar),
+                       nest 4 (ptext (sLit "does not appear in the type") <+> quotes (ppr ty))]
                   $$
                   doc)
 
 opTyErr :: RdrName -> HsType RdrName -> SDoc
 opTyErr op ty@(HsOpTy ty1 _ _)
-  = hang (ptext SLIT("Illegal operator") <+> quotes (ppr op) <+> ptext SLIT("in type") <+> quotes (ppr ty))
+  = hang (ptext (sLit "Illegal operator") <+> quotes (ppr op) <+> ptext (sLit "in type") <+> quotes (ppr ty))
         2 extra
   where
     extra | op == dot_tv_RDR && forall_head ty1
-         = ptext SLIT("Perhaps you intended to use -XRankNTypes or similar flag")
+         = perhapsForallMsg
          | otherwise 
-         = ptext SLIT("Use -XTypeOperators to allow operators in types")
+         = ptext (sLit "Use -XTypeOperators to allow operators in types")
 
     forall_head (L _ (HsTyVar tv))   = tv == forall_tv_RDR
     forall_head (L _ (HsAppTy ty _)) = forall_head ty