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) )
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 )
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
~~~~~~~~~~~~~~~~~~~
\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}