-- 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
eqHsSig (NoInlineSig n1 _ _) (NoInlineSig n2 _ _) = n1 == n2
eqHsSig (SpecInstSig ty1 _) (SpecInstSig ty2 _) = ty1 == ty2
-eqHsSig (SpecSig n1 ty1 _) (SpecSig n2 ty2 _)
- = -- may have many specialisations for one value;
+eqHsSig (SpecSig n1 ty1 _) (SpecSig n2 ty2 _) =
+ -- 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
\end{code}