diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2021-03-28 16:17:34 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2021-03-28 16:17:34 +0300 |
commit | df27e931cc1961952aeb30df886182419974cdbe (patch) | |
tree | 74cebdef62d525e0b27a10663b6620e03cca3626 /compiler/Language | |
parent | c57e3d459a4dc1644603f30a75d0e8d56794300b (diff) | |
download | haskell-wip/remove-noghctc.tar.gz |
WIP: Remove NoGhcTc from HsMatchContextwip/remove-noghctc
Diffstat (limited to 'compiler/Language')
-rw-r--r-- | compiler/Language/Haskell/Syntax/Expr.hs | 11 | ||||
-rw-r--r-- | compiler/Language/Haskell/Syntax/Extension.hs | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs index 171ce08bfa..aff5d17eb0 100644 --- a/compiler/Language/Haskell/Syntax/Expr.hs +++ b/compiler/Language/Haskell/Syntax/Expr.hs @@ -438,7 +438,7 @@ data HsExpr p -- For details on above see note [Api annotations] in GHC.Parser.Annotation | HsDo (XDo p) -- Type of the whole expression - (HsStmtContext (HsDoRn p)) + (HsStmtContext p) -- The parameterisation of the above is unimportant -- because in this context we never use -- the PatGuard or ParStmt variant @@ -613,7 +613,6 @@ data HsExpr p -- | The AST used to hard-refer to GhcPass, which was a layer violation. For now, -- we paper it over with this new extension point. -type family HsDoRn p type family HsBracketRn p type family PendingRnSplice' p type family PendingTcSplice' p @@ -1624,7 +1623,7 @@ data ArithSeqInfo id -- Context of a pattern match. This is more subtle than it would seem. See Note -- [Varieties of pattern matches]. data HsMatchContext p - = FunRhs { mc_fun :: LIdP p -- ^ function binder of @f@ + = FunRhs { mc_fun :: XRec p (CtxIdP p) -- ^ function binder of @f@ , mc_fixity :: LexicalFixity -- ^ fixing of @f@ , mc_strictness :: SrcStrictness -- ^ was @f@ banged? -- See Note [FunBind vs PatBind] @@ -1714,7 +1713,7 @@ matchSeparator ThPatSplice = panic "unused" matchSeparator ThPatQuote = panic "unused" matchSeparator PatSyn = panic "unused" -pprMatchContext :: (Outputable (IdP p), UnXRec p) +pprMatchContext :: (Outputable (CtxIdP p), UnXRec p) => HsMatchContext p -> SDoc pprMatchContext ctxt | want_an ctxt = text "an" <+> pprMatchContextNoun ctxt @@ -1724,7 +1723,7 @@ pprMatchContext ctxt want_an ProcExpr = True want_an _ = False -pprMatchContextNoun :: forall p. (Outputable (IdP p), UnXRec p) +pprMatchContextNoun :: forall p. (Outputable (CtxIdP p), UnXRec p) => HsMatchContext p -> SDoc pprMatchContextNoun (FunRhs {mc_fun=fun}) = text "equation for" @@ -1743,7 +1742,7 @@ pprMatchContextNoun (StmtCtxt ctxt) = text "pattern binding in" pprMatchContextNoun PatSyn = text "pattern synonym declaration" ----------------- -pprAStmtContext, pprStmtContext :: (Outputable (IdP p), UnXRec p) +pprAStmtContext, pprStmtContext :: (Outputable (CtxIdP p), UnXRec p) => HsStmtContext p -> SDoc pprAStmtContext ctxt = article <+> pprStmtContext ctxt where diff --git a/compiler/Language/Haskell/Syntax/Extension.hs b/compiler/Language/Haskell/Syntax/Extension.hs index a9bef9b610..5514a068ed 100644 --- a/compiler/Language/Haskell/Syntax/Extension.hs +++ b/compiler/Language/Haskell/Syntax/Extension.hs @@ -150,6 +150,9 @@ class WrapXRec p a where -- | Maps the "normal" id type for a given pass type family IdP p +-- | Maps the context id type for a given pass +type family CtxIdP p + type LIdP p = XRec p (IdP p) -- ===================================================================== |