#include "HsVersions.h"
-import {-# SOURCE #-} HsExpr ( pprExpr, HsExpr, pprMatches, Match, pprGRHSs, GRHSs )
+import {-# SOURCE #-} HsExpr ( HsExpr, pprExpr,
+ Match, pprFunBind,
+ GRHSs, pprPatBind )
-- friends:
import HsTypes ( HsType )
ppr_monobind (AndMonoBinds binds1 binds2)
= ppr_monobind binds1 $$ ppr_monobind binds2
-ppr_monobind (PatMonoBind pat grhss locn)
- = sep [ppr pat, nest 4 (pprGRHSs False grhss)]
-
-ppr_monobind (FunMonoBind fun inf matches locn)
- = pprMatches (False, ppr fun) matches
+ppr_monobind (PatMonoBind pat grhss locn) = pprPatBind pat grhss
+ppr_monobind (FunMonoBind fun inf matches locn) = pprFunBind fun matches
-- ToDo: print infix if appropriate
ppr_monobind (VarMonoBind name expr)
-- current instance decl
SrcLoc
- | InlineInstSig (Maybe Int) -- phase
- SrcLoc
-
| FixSig (FixitySig name) -- Fixity declaration
okInstDclSig ns (Sig _ _ _) = False
okInstDclSig ns (FixSig _) = False
okInstDclSig ns (SpecInstSig _ _) = True
-okInstDclSig ns (InlineInstSig _ _) = True
okInstDclSig ns sig = sigForThisGroup ns sig
sigForThisGroup ns sig
isPragSig (InlineSig _ _ _) = True
isPragSig (NoInlineSig _ _ _) = True
isPragSig (SpecInstSig _ _) = True
-isPragSig (InlineInstSig _ _) = True
isPragSig other = False
\end{code}
hsSigDoc (InlineSig _ _ loc) = (SLIT("INLINE pragma"),loc)
hsSigDoc (NoInlineSig _ _ loc) = (SLIT("NOINLINE pragma"),loc)
hsSigDoc (SpecInstSig _ loc) = (SLIT("SPECIALISE instance pragma"),loc)
-hsSigDoc (InlineInstSig _ loc) = (SLIT("INLINE instance pragma"),loc)
hsSigDoc (FixSig (FixitySig _ _ loc)) = (SLIT("fixity declaration"), loc)
\end{code}
ppr_sig (SpecInstSig ty _)
= hsep [text "{-# SPECIALIZE instance", ppr ty, text "#-}"]
-ppr_sig (InlineInstSig phase _)
- = hsep [text "{-# INLINE instance", ppr_phase phase, text "#-}"]
-
ppr_sig (FixSig fix_sig) = ppr fix_sig
-- may have many specialisations for one value;
-- but not ones that are exactly the same...
(n1 == n2) && (ty1 == ty2)
-eqHsSig (InlineInstSig _ _) (InlineInstSig _ _) = True
-eqHsSig other_1 other_2 = False
+eqHsSig _other1 _other2 = False
\end{code}