HsConPatDetails, hsConPatArgs,
HsRecFields(..), HsRecField(..), hsRecFields,
+ HsQuasiQuote(..),
+
mkPrefixConPat, mkCharLitPat, mkNilPat, mkCoPat, mkCoPatCoI,
isBangHsBind,
import Outputable
import Type
import SrcLoc
+import FastString
\end{code}
-- (= the argument type of the view function)
-- for hsPatType.
+ ------------ Quasiquoted patterns ---------------
+ -- See Note [Quasi-quote overview] in TcSplice
+ | QuasiQuotePat (HsQuasiQuote id)
+
------------ Literal and n+k patterns ---------------
| LitPat HsLit -- Used for *non-overloaded* literal patterns:
-- Int#, Char#, Int, Char, String, etc.
hsRecFields rbinds = map (unLoc . hsRecFieldId) (rec_flds rbinds)
\end{code}
+\begin{code}
+data HsQuasiQuote id = HsQuasiQuote
+ id
+ id
+ SrcSpan
+ FastString
+\end{code}
+
%************************************************************************
%* *
pprPat (NPat l Nothing _) = ppr l
pprPat (NPat l (Just _) _) = char '-' <> ppr l
pprPat (NPlusKPat n k _ _) = hcat [ppr n, char '+', ppr k]
+pprPat (QuasiQuotePat (HsQuasiQuote name quoter _ quote))
+ = char '$' <> brackets (ppr name) <>
+ ptext SLIT("[:") <> ppr quoter <> ptext SLIT("|") <>
+ ppr quote <> ptext SLIT("|]")
pprPat (TypePat ty) = ptext SLIT("{|") <> ppr ty <> ptext SLIT("|}")
pprPat (CoPat co pat _) = parens (pprHsWrapper (ppr pat) co)
pprPat (SigPatIn pat ty) = ppr pat <+> dcolon <+> ppr ty