summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax/Pat.hs
diff options
context:
space:
mode:
authorDanielRrr <daniel.rogozin@serokell.io>2021-11-03 20:51:12 +0300
committerDanielRrr <daniel.rogozin@serokell.io>2022-07-23 15:07:34 +0300
commitfab6aad1921af2bbb6bc3a11ea8a7c46eb553ec2 (patch)
tree7459a3e5b2edab7a3b099beec3a9dca22369d552 /compiler/Language/Haskell/Syntax/Pat.hs
parent81d65f7f358fdbd1d13b89c43fc4cbe3ac82d24b (diff)
downloadhaskell-wip/17594-another-approach.tar.gz
parser and renamer checkpointwip/17594-another-approach
Metric Decrease: T16875
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Pat.hs')
-rw-r--r--compiler/Language/Haskell/Syntax/Pat.hs14
1 files changed, 12 insertions, 2 deletions
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)
-- ---------------------------------------------------------------------