diff options
author | DanielRrr <daniel.rogozin@serokell.io> | 2021-11-03 20:51:12 +0300 |
---|---|---|
committer | DanielRrr <daniel.rogozin@serokell.io> | 2022-07-23 15:07:34 +0300 |
commit | fab6aad1921af2bbb6bc3a11ea8a7c46eb553ec2 (patch) | |
tree | 7459a3e5b2edab7a3b099beec3a9dca22369d552 /compiler/Language/Haskell/Syntax | |
parent | 81d65f7f358fdbd1d13b89c43fc4cbe3ac82d24b (diff) | |
download | haskell-wip/17594-another-approach.tar.gz |
parser and renamer checkpointwip/17594-another-approach
Metric Decrease:
T16875
Diffstat (limited to 'compiler/Language/Haskell/Syntax')
-rw-r--r-- | compiler/Language/Haskell/Syntax/Expr.hs | 4 | ||||
-rw-r--r-- | compiler/Language/Haskell/Syntax/Extension.hs | 4 | ||||
-rw-r--r-- | compiler/Language/Haskell/Syntax/Pat.hs | 14 |
3 files changed, 18 insertions, 4 deletions
diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs index 326c9903dc..5f774de2e4 100644 --- a/compiler/Language/Haskell/Syntax/Expr.hs +++ b/compiler/Language/Haskell/Syntax/Expr.hs @@ -976,8 +976,8 @@ data Match p body = Match { m_ext :: XCMatch p body, m_ctxt :: HsMatchContext p, - -- See Note [m_ctxt in Match] - m_pats :: [LPat p], -- The patterns + -- See note [m_ctxt in Match] + m_pats :: [LMatchPat p], -- The patterns m_grhss :: (GRHSs p body) } | XMatch !(XXMatch p body) diff --git a/compiler/Language/Haskell/Syntax/Extension.hs b/compiler/Language/Haskell/Syntax/Extension.hs index 4bdb3ce3cb..bea00f86f8 100644 --- a/compiler/Language/Haskell/Syntax/Extension.hs +++ b/compiler/Language/Haskell/Syntax/Extension.hs @@ -604,6 +604,10 @@ type family XSigPat x type family XCoPat x type family XXPat x type family XHsFieldBind x +type family XVisPat x +type family XInvisTyVarPat x +type family XInvisWildTyPat x +type family XXMatchPat x -- ===================================================================== -- Type families for the HsTypes type families diff --git a/compiler/Language/Haskell/Syntax/Pat.hs b/compiler/Language/Haskell/Syntax/Pat.hs index 95abde9ce0..5f5f73362c 100644 --- a/compiler/Language/Haskell/Syntax/Pat.hs +++ b/compiler/Language/Haskell/Syntax/Pat.hs @@ -19,8 +19,7 @@ -- See Note [Language.Haskell.Syntax.* Hierarchy] for why not GHC.Hs.* module Language.Haskell.Syntax.Pat ( - Pat(..), LPat, - ConLikeP, + Pat(..), LPat, MatchPat(..), LMatchPat, ConLikeP, HsConPatDetails, hsConPatArgs, HsConPatTyArg(..), @@ -224,6 +223,17 @@ data Pat p type family ConLikeP x +-- | A pattern to be used in a sequence of patterns, like what appears +-- to the right of @f@ in @f a b True = ...@. A 'MatchPat' allows for the +-- possibility of binding a /type variable/ with \@. +data MatchPat pass + = VisPat (XVisPat pass) (LPat pass) + -- () means that we don't accept f @{x} syntax + | InvisTyVarPat (XInvisTyVarPat pass) (LHsTyVarBndr () pass) + | InvisWildTyPat (XInvisWildTyPat pass) + | XMatchPat !(XXMatchPat pass) + +type LMatchPat pass = XRec pass (MatchPat pass) -- --------------------------------------------------------------------- |