summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax/Expr.hs
diff options
context:
space:
mode:
authorShayne Fletcher <shayne@shaynefletcher.org>2021-05-15 21:15:41 +1000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-19 23:40:12 -0400
commitd48b7e5c2fae5db1973a767be45aba82b2aa727c (patch)
treeb0af0b799854da5e4b9efbe29a24e02d4db71641 /compiler/Language/Haskell/Syntax/Expr.hs
parentdf4a0a53691cd833f54eb443401243dd9c964196 (diff)
downloadhaskell-d48b7e5c2fae5db1973a767be45aba82b2aa727c.tar.gz
Changes to HsRecField'
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Expr.hs')
-rw-r--r--compiler/Language/Haskell/Syntax/Expr.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs
index e7afc89226..a9592304e6 100644
--- a/compiler/Language/Haskell/Syntax/Expr.hs
+++ b/compiler/Language/Haskell/Syntax/Expr.hs
@@ -100,7 +100,7 @@ minimize modifying existing code by having these new rules calculate
@LHsRecProj GhcPs (Located b)@ ("record projection") values instead:
@
newtype FieldLabelStrings = FieldLabelStrings [Located FieldLabelString]
-type RecProj arg = HsRecField' FieldLabelStrings arg
+type RecProj arg = HsFieldBind FieldLabelStrings arg
type LHsRecProj p arg = Located (RecProj arg)
@
@@ -137,6 +137,8 @@ values (see function @mkRdrRecordUpd@ in 'GHC.Parser.PostProcess').
-- | RecordDotSyntax field updates
+type LFieldLabelStrings p = XRec p (FieldLabelStrings p)
+
newtype FieldLabelStrings p =
FieldLabelStrings [Located (HsFieldLabel p)]
@@ -148,6 +150,10 @@ instance OutputableBndr (FieldLabelStrings p) where
pprInfixOcc = pprFieldLabelStrings
pprPrefixOcc = pprFieldLabelStrings
+instance OutputableBndr (Located (FieldLabelStrings p)) where
+ pprInfixOcc = pprInfixOcc . unLoc
+ pprPrefixOcc = pprInfixOcc . unLoc
+
pprFieldLabelStrings :: FieldLabelStrings p -> SDoc
pprFieldLabelStrings (FieldLabelStrings flds) =
hcat (punctuate dot (map (ppr . unLoc) flds))
@@ -158,7 +164,7 @@ instance Outputable (HsFieldLabel p) where
-- Field projection updates (e.g. @foo.bar.baz = 1@). See Note
-- [RecordDotSyntax field updates].
-type RecProj p arg = HsRecField' (FieldLabelStrings p) arg
+type RecProj p arg = HsFieldBind (LFieldLabelStrings p) arg
-- The phantom type parameter @p@ is for symmetry with @LHsRecField p
-- arg@ in the definition of @data Fbind@ (see GHC.Parser.Process).