[project @ 1997-06-09 07:41:09 by sof]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcMatches.lhs
index 8a7d520..a5ca1dd 100644 (file)
@@ -10,8 +10,14 @@ module TcMatches ( tcMatchesFun, tcMatchesCase, tcMatch ) where
 
 IMP_Ubiq()
 
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
+IMPORT_DELOOPER(TcLoop)                ( tcGRHSsAndBinds )
+#else
+import {-# SOURCE #-} TcGRHSs ( tcGRHSsAndBinds )
+#endif
+
 import HsSyn           ( Match(..), GRHSsAndBinds(..), GRHS(..), InPat,
-                         HsExpr, HsBinds, OutPat, Fake,
+                         HsExpr, HsBinds, OutPat, Fake, Stmt,
                          collectPatBinders, pprMatch )
 import RnHsSyn         ( SYN_IE(RenamedMatch) )
 import TcHsSyn         ( TcIdOcc(..), SYN_IE(TcMatch) )
@@ -19,7 +25,6 @@ import TcHsSyn                ( TcIdOcc(..), SYN_IE(TcMatch) )
 import TcMonad
 import Inst            ( Inst, SYN_IE(LIE), plusLIE )
 import TcEnv           ( newMonoIds )
-IMPORT_DELOOPER(TcLoop)                ( tcGRHSsAndBinds )
 import TcPat           ( tcPat )
 import TcType          ( SYN_IE(TcType), TcMaybe, zonkTcType )
 import Unify           ( unifyTauTy, unifyTauTyList )
@@ -29,6 +34,11 @@ import Kind          ( Kind, mkTypeKind )
 import Pretty
 import Type            ( isTyVarTy, mkFunTy, getFunTy_maybe )
 import Util
+import Outputable
+#if __GLASGOW_HASKELL__ >= 202
+import SrcLoc           (SrcLoc)
+#endif
+
 \end{code}
 
 @tcMatchesFun@ typechecks a @[Match]@ list which occurs in a
@@ -208,16 +218,16 @@ Errors and contexts
 ~~~~~~~~~~~~~~~~~~~
 \begin{code}
 matchCtxt MCase match sty
-  = ppHang (ppStr "In a \"case\" branch:")
+  = hang (ptext SLIT("In a \"case\" branch:"))
         4 (pprMatch sty True{-is_case-} match)
 
 matchCtxt (MFun fun) match sty
-  = ppHang (ppBesides [ppStr "In an equation for function ", ppr sty fun, ppChar ':'])
-        4 (ppBesides [ppr sty fun, ppSP, pprMatch sty False{-not case-} match])
+  = hang (hcat [ptext SLIT("In an equation for function "), ppr sty fun, char ':'])
+        4 (pprQuote sty $ \sty -> hcat [ppr sty fun, space, pprMatch sty False{-not case-} match])
 \end{code}
 
 
 \begin{code}
 varyingArgsErr name matches sty
-  = ppSep [ppStr "Varying number of arguments for function", ppr sty name]
+  = sep [ptext SLIT("Varying number of arguments for function"), ppr sty name]
 \end{code}