Apoorv Ingle pushed to branch wip/ani/T27156 at Glasgow Haskell Compiler / GHC
Commits:
-
c08de6dd
by Apoorv Ingle at 2026-11-01T22:53:44-06:00
15 changed files:
- compiler/GHC/Builtin/TH.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Tc/Gen/Expand.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
Changes:
| ... | ... | @@ -108,7 +108,7 @@ varEOcc, conEOcc, litEOcc, appEOcc, appTypeEOcc, infixAppOcc, sectionLOcc, |
| 108 | 108 | unboxedSumEOcc, condEOcc, multiIfEOcc, letEOcc, caseEOcc, doEOcc, mdoEOcc,
|
| 109 | 109 | compEOcc, staticEOcc, unboundVarEOcc, labelEOcc, implicitParamVarEOcc,
|
| 110 | 110 | getFieldEOcc, projectionEOcc, typeEOcc, forallEOcc, forallVisEOcc,
|
| 111 | - constrainedEOcc :: KnownOcc
|
|
| 111 | + constrainedEOcc, resynbindEOcc :: KnownOcc
|
|
| 112 | 112 | varEOcc = mkVarOcc "varE"
|
| 113 | 113 | conEOcc = mkVarOcc "conE"
|
| 114 | 114 | litEOcc = mkVarOcc "litE"
|
| ... | ... | @@ -152,6 +152,7 @@ typeEOcc = mkVarOcc "typeE" |
| 152 | 152 | forallEOcc = mkVarOcc "forallE"
|
| 153 | 153 | forallVisEOcc = mkVarOcc "forallVisE"
|
| 154 | 154 | constrainedEOcc = mkVarOcc "constrainedE"
|
| 155 | +resynbindEOcc = mkVarOcc "reSynBindsE"
|
|
| 155 | 156 | |
| 156 | 157 | -- type FieldExp = ...
|
| 157 | 158 | fieldExpOcc :: KnownOcc
|
| ... | ... | @@ -666,7 +666,7 @@ type instance XXExpr GhcTc = XXExprGhcTc |
| 666 | 666 | ********************************************************************* -}
|
| 667 | 667 | |
| 668 | 668 | data XXExprGhcPs
|
| 669 | - = ReSynBinds HsModuleName (HsExpr GhcPs)
|
|
| 669 | + = ReSynBindsPs HsModuleName (HsExpr GhcPs)
|
|
| 670 | 670 | |
| 671 | 671 | |
| 672 | 672 | -- See Note [Rebindable syntax and XXExprGhcRn]
|
| ... | ... | @@ -684,6 +684,7 @@ data XXExprGhcRn |
| 684 | 684 | | HsRecSelRn (FieldOcc GhcRn) -- ^ Variable pointing to record selector
|
| 685 | 685 | -- See Note [Non-overloaded record field selectors] and
|
| 686 | 686 | -- Note [Record selectors in the AST]
|
| 687 | + | ReSynBindsRn HsModuleName (HsExpr GhcRn)
|
|
| 687 | 688 | |
| 688 | 689 | |
| 689 | 690 | data XXExprGhcTc
|
| ... | ... | @@ -714,6 +715,7 @@ data XXExprGhcTc |
| 714 | 715 | | HsRecSelTc (FieldOcc GhcTc) -- ^ Variable pointing to record selector
|
| 715 | 716 | -- See Note [Non-overloaded record field selectors] and
|
| 716 | 717 | -- Note [Record selectors in the AST]
|
| 718 | + | ReSynBindsTc HsModuleName (HsExpr GhcTc)
|
|
| 717 | 719 | |
| 718 | 720 | {- *********************************************************************
|
| 719 | 721 | * *
|
| ... | ... | @@ -1039,7 +1041,7 @@ ppr_expr (XExpr x) = case ghcPass @p of |
| 1039 | 1041 | GhcTc -> ppr x
|
| 1040 | 1042 | |
| 1041 | 1043 | instance Outputable XXExprGhcPs where
|
| 1042 | - ppr (ReSynBinds m e) = text "{{" <+> ppr m <+> text "}}" <+> ppr e
|
|
| 1044 | + ppr (ReSynBindsPs m e) = text "{{" <+> ppr m <+> text "}}" <+> ppr e
|
|
| 1043 | 1045 | |
| 1044 | 1046 | ppr_hse :: forall p. (IsPass p) => HsExpansion (GhcPass p) -> SDoc
|
| 1045 | 1047 | ppr_hse hse
|
| ... | ... | @@ -1061,6 +1063,7 @@ ppr_hse hse |
| 1061 | 1063 | instance Outputable XXExprGhcRn where
|
| 1062 | 1064 | ppr (HsRecSelRn f) = pprPrefixOcc f
|
| 1063 | 1065 | ppr (ExpandedThingRn hse) = ppr_hse hse
|
| 1066 | + ppr (ReSynBindsRn m e) = text "{{" <+> ppr m <+> text "}}" <+> ppr e
|
|
| 1064 | 1067 | |
| 1065 | 1068 | |
| 1066 | 1069 | instance Outputable XXExprGhcTc where
|
| ... | ... | @@ -1088,6 +1091,8 @@ instance Outputable XXExprGhcTc where |
| 1088 | 1091 | ppr exp, text ")"]
|
| 1089 | 1092 | ppr (HsRecSelTc f) = pprPrefixOcc f
|
| 1090 | 1093 | |
| 1094 | + ppr (ReSynBindsTc m e) = text "{{" <+> ppr m <+> text "}}" <+> ppr e
|
|
| 1095 | + |
|
| 1091 | 1096 | ppr_infix_expr :: forall p. (OutputableBndrId p) => HsExpr (GhcPass p) -> Maybe SDoc
|
| 1092 | 1097 | ppr_infix_expr (HsVar _ (L _ v)) = Just (pprInfixOcc v)
|
| 1093 | 1098 | ppr_infix_expr (HsHole x) = Just $ pprInfixOcc $ case (ghcPass @p, x) of
|
| ... | ... | @@ -1102,11 +1107,12 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of |
| 1102 | 1107 | ppr_infix_expr _ = Nothing
|
| 1103 | 1108 | |
| 1104 | 1109 | ppr_infix_expr_ps :: XXExprGhcPs -> Maybe SDoc
|
| 1105 | -ppr_infix_expr_ps (ReSynBinds{}) = Nothing
|
|
| 1110 | +ppr_infix_expr_ps (ReSynBindsPs{}) = Nothing
|
|
| 1106 | 1111 | |
| 1107 | 1112 | ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc
|
| 1108 | 1113 | ppr_infix_expr_rn (ExpandedThingRn (HSE thing _)) = ppr_infix_hs_expansion thing
|
| 1109 | 1114 | ppr_infix_expr_rn (HsRecSelRn f) = Just (pprInfixOcc f)
|
| 1115 | +ppr_infix_expr_rn (ReSynBindsRn _ e) = ppr_infix_expr e
|
|
| 1110 | 1116 | |
| 1111 | 1117 | ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc
|
| 1112 | 1118 | ppr_infix_expr_tc (WrapExpr _ e) = ppr_infix_expr e
|
| ... | ... | @@ -1115,6 +1121,7 @@ ppr_infix_expr_tc (ConLikeTc con) = Just (pprInfixOcc (conLikeName co |
| 1115 | 1121 | ppr_infix_expr_tc (HsTick {}) = Nothing
|
| 1116 | 1122 | ppr_infix_expr_tc (HsBinTick {}) = Nothing
|
| 1117 | 1123 | ppr_infix_expr_tc (HsRecSelTc f) = Just (pprInfixOcc f)
|
| 1124 | +ppr_infix_expr_tc (ReSynBindsTc _ e) = ppr_infix_expr e
|
|
| 1118 | 1125 | |
| 1119 | 1126 | ppr_infix_hs_expansion :: HsCtxt -> Maybe SDoc
|
| 1120 | 1127 | ppr_infix_hs_expansion (ExprCtxt e) = ppr_infix_expr e
|
| ... | ... | @@ -1199,7 +1206,7 @@ hsExprNeedsParens prec = go |
| 1199 | 1206 | GhcRn -> go_x_rn x
|
| 1200 | 1207 | |
| 1201 | 1208 | go_x_ps :: XXExprGhcPs -> Bool
|
| 1202 | - go_x_ps (ReSynBinds _ e) = hsExprNeedsParens prec e
|
|
| 1209 | + go_x_ps (ReSynBindsPs _ e) = hsExprNeedsParens prec e
|
|
| 1203 | 1210 | |
| 1204 | 1211 | go_x_tc :: XXExprGhcTc -> Bool
|
| 1205 | 1212 | go_x_tc (WrapExpr _ e) = hsExprNeedsParens prec e
|
| ... | ... | @@ -1208,10 +1215,12 @@ hsExprNeedsParens prec = go |
| 1208 | 1215 | go_x_tc (HsTick _ (L _ e)) = hsExprNeedsParens prec e
|
| 1209 | 1216 | go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e
|
| 1210 | 1217 | go_x_tc (HsRecSelTc{}) = False
|
| 1218 | + go_x_tc (ReSynBindsTc _ e) = hsExprNeedsParens prec e
|
|
| 1211 | 1219 | |
| 1212 | 1220 | go_x_rn :: XXExprGhcRn -> Bool
|
| 1213 | 1221 | go_x_rn (ExpandedThingRn (HSE thing _)) = hsExpandedNeedsParens thing
|
| 1214 | 1222 | go_x_rn (HsRecSelRn{}) = False
|
| 1223 | + go_x_rn (ReSynBindsRn _ e) = hsExprNeedsParens prec e
|
|
| 1215 | 1224 | |
| 1216 | 1225 | hsExpandedNeedsParens :: HsCtxt -> Bool
|
| 1217 | 1226 | hsExpandedNeedsParens (ExprCtxt e) = hsExprNeedsParens prec e
|
| ... | ... | @@ -1260,10 +1269,12 @@ isAtomicHsExpr (XExpr x) |
| 1260 | 1269 | go_x_tc (HsTick {}) = False
|
| 1261 | 1270 | go_x_tc (HsBinTick {}) = False
|
| 1262 | 1271 | go_x_tc (HsRecSelTc{}) = True
|
| 1272 | + go_x_tc (ReSynBindsTc _ e) = isAtomicHsExpr e
|
|
| 1263 | 1273 | |
| 1264 | 1274 | go_x_rn :: XXExprGhcRn -> Bool
|
| 1265 | 1275 | go_x_rn (ExpandedThingRn (HSE thing _)) = isAtomicExpandedThingRn thing
|
| 1266 | 1276 | go_x_rn (HsRecSelRn{}) = True
|
| 1277 | + go_x_rn (ReSynBindsRn _ e) = isAtomicHsExpr e
|
|
| 1267 | 1278 | |
| 1268 | 1279 | isAtomicExpandedThingRn :: HsCtxt -> Bool
|
| 1269 | 1280 | isAtomicExpandedThingRn (ExprCtxt e) = isAtomicHsExpr e
|
| ... | ... | @@ -2388,7 +2399,7 @@ type instance XTypBr GhcPs = (EpToken "[t|", EpUniToken "|]" "⟧") |
| 2388 | 2399 | type instance XVarBr GhcPs = EpaLocation
|
| 2389 | 2400 | type instance XXQuote GhcPs = DataConCantHappen
|
| 2390 | 2401 | |
| 2391 | -type instance XExpBr GhcRn = NoExtField
|
|
| 2402 | +type instance XExpBr GhcRn = NoExtField -- TODO ANI: What if we add the module name here?
|
|
| 2392 | 2403 | type instance XPatBr GhcRn = NoExtField
|
| 2393 | 2404 | type instance XDecBrL GhcRn = NoExtField
|
| 2394 | 2405 | type instance XDecBrG GhcRn = NoExtField
|
| ... | ... | @@ -170,6 +170,7 @@ hsExprType (XExpr (ConLikeTc con)) = conLikeType con |
| 170 | 170 | hsExprType (XExpr (HsTick _ e)) = lhsExprType e
|
| 171 | 171 | hsExprType (XExpr (HsBinTick _ _ e)) = lhsExprType e
|
| 172 | 172 | hsExprType (XExpr (HsRecSelTc (FieldOcc _ id))) = idType (unLoc id)
|
| 173 | +hsExprType (XExpr (ReSynBindsTc _ e)) = hsExprType e
|
|
| 173 | 174 | |
| 174 | 175 | arithSeqInfoType :: ArithSeqInfo GhcTc -> Type
|
| 175 | 176 | arithSeqInfoType asi = mkListTy $ case asi of
|
| ... | ... | @@ -310,6 +310,10 @@ dsExpr e@(XExpr ext_expr_tc) |
| 310 | 310 | ConLikeTc {} -> dsApp e
|
| 311 | 311 | |
| 312 | 312 | ExpandedThingTc (HSE _ e) -> dsLExpr e
|
| 313 | + ReSynBindsTc m e ->
|
|
| 314 | + do
|
|
| 315 | + tracePm "dsExpr XExpr" (ppr m)
|
|
| 316 | + dsExpr e --TODO ANI: This should never happen?
|
|
| 313 | 317 | |
| 314 | 318 | -- Hpc Support
|
| 315 | 319 | HsTick tickish e -> do
|
| ... | ... | @@ -570,7 +574,9 @@ dsExpr (RecordCon { rcon_con = L _ con_like |
| 570 | 574 | -- Template Haskell stuff
|
| 571 | 575 | -- See Note [The life cycle of a TH quotation]
|
| 572 | 576 | |
| 573 | -dsExpr (HsTypedBracket bracket_tc _) = dsBracket bracket_tc
|
|
| 577 | +dsExpr (HsTypedBracket bracket_tc _) = do
|
|
| 578 | + tracePm "dsExpr:dsBracket typed bracket" empty
|
|
| 579 | + dsBracket bracket_tc
|
|
| 574 | 580 | dsExpr (HsUntypedBracket bracket_tc _) = dsBracket bracket_tc
|
| 575 | 581 | dsExpr (HsTypedSplice _ s) = pprPanic "dsExpr:typed splice" (pprTypedSplice Nothing s)
|
| 576 | 582 | dsExpr (HsUntypedSplice ext _) = dataConCantHappen ext
|
| ... | ... | @@ -1763,6 +1763,9 @@ repE e@(XExpr (ExpandedThingRn (HSE o x))) |
| 1763 | 1763 | | otherwise
|
| 1764 | 1764 | = notHandled (ThExpressionForm e)
|
| 1765 | 1765 | repE (XExpr (HsRecSelRn (FieldOcc _ (L _ x)))) = repE (mkHsVar (noLocA x))
|
| 1766 | +repE (XExpr (ReSynBindsRn m e)) = do
|
|
| 1767 | + e' <- repE e
|
|
| 1768 | + repReSynBindsE m e'
|
|
| 1766 | 1769 | repE e@(HsPragE _ (HsPragSCC {}) _) = notHandled (ThCostCentres e)
|
| 1767 | 1770 | repE e@(HsTypedBracket{}) = notHandled (ThExpressionForm e)
|
| 1768 | 1771 | repE e@(HsUntypedBracket{}) = notHandled (ThExpressionForm e)
|
| ... | ... | @@ -2613,6 +2616,16 @@ repDoE = repDoBlock doEOcc |
| 2613 | 2616 | repMDoE :: Maybe HsModuleName -> Core [(M TH.Stmt)] -> MetaM (Core (M TH.Exp))
|
| 2614 | 2617 | repMDoE = repDoBlock mdoEOcc
|
| 2615 | 2618 | |
| 2619 | +repReSynBindsE :: HsModuleName -> Core (M TH.Exp) -> MetaM (Core (M TH.Exp))
|
|
| 2620 | +repReSynBindsE m (MkC e) = do
|
|
| 2621 | + MkC coreModName <- coreModNameM
|
|
| 2622 | + krep2 resynbindEOcc [coreModName, e]
|
|
| 2623 | + where
|
|
| 2624 | + coreModNameM :: MetaM (Core TH.ModName)
|
|
| 2625 | + coreModNameM = do
|
|
| 2626 | + MkC s <- lift $ coreStringLit (moduleNameFS (hsModuleName m))
|
|
| 2627 | + rep2_nw mkModNameOcc [s]
|
|
| 2628 | + |
|
| 2616 | 2629 | repDoBlock :: KnownOcc -> Maybe HsModuleName -> Core [(M TH.Stmt)] -> MetaM (Core (M TH.Exp))
|
| 2617 | 2630 | repDoBlock doName maybeModName (MkC ss) = do
|
| 2618 | 2631 | MkC coreModName <- coreModNameM
|
| ... | ... | @@ -708,6 +708,9 @@ addTickHsExpr (XExpr (HsBinTick t0 t1 e)) = |
| 708 | 708 | liftM (XExpr . HsBinTick t0 t1) (addTickLHsExprNever e)
|
| 709 | 709 | |
| 710 | 710 | addTickHsExpr e@(XExpr (HsRecSelTc (FieldOcc _ id))) = do freeVar (unLoc id); return e
|
| 711 | +addTickHsExpr (XExpr (ReSynBindsTc m e)) =
|
|
| 712 | + liftM (XExpr . ReSynBindsTc m) (addTickHsExpr e)
|
|
| 713 | + |
|
| 711 | 714 | |
| 712 | 715 | addTickHsExpr (HsDo srcloc cxt (L l stmts))
|
| 713 | 716 | = do { (stmts', _) <- addTickLStmts' forQual stmts (return ())
|
| ... | ... | @@ -1377,6 +1377,8 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where |
| 1377 | 1377 | HsBinTick _ _ expr
|
| 1378 | 1378 | -> [ toHie expr
|
| 1379 | 1379 | ]
|
| 1380 | + ReSynBindsTc _ _
|
|
| 1381 | + -> []
|
|
| 1380 | 1382 | HsRecSelTc fld
|
| 1381 | 1383 | -> [ toHie $ RFC RecFieldOcc Nothing (L mspan fld)
|
| 1382 | 1384 | ]
|
| ... | ... | @@ -607,10 +607,10 @@ rnExpr (HsFunArr _ mult arg res) |
| 607 | 607 | _ -> False
|
| 608 | 608 | oneType = noLocA $ HsVar noExtField $ noLocA $ noUserRdr oneDataConName
|
| 609 | 609 | |
| 610 | -rnExpr (XExpr (ReSynBinds m e'))
|
|
| 610 | +rnExpr (XExpr (ReSynBindsPs m e))
|
|
| 611 | 611 | = do { traceRn "XExpr ReSynBinds" (text "module:" <+> ppr m)
|
| 612 | - ; rnExpr e' -- for now just return the renamed expression
|
|
| 613 | - -- TODO: Bring into scope top level environment of the module m
|
|
| 612 | + ; (e', fvs) <- rnExpr e
|
|
| 613 | + ; return (e', fvs)
|
|
| 614 | 614 | }
|
| 615 | 615 | |
| 616 | 616 | {-
|
| ... | ... | @@ -287,6 +287,7 @@ tcExpand e@(HsUntypedSplice splice_res _) |
| 287 | 287 | |
| 288 | 288 | ------------------------
|
| 289 | 289 | -- XExpr
|
| 290 | + |
|
| 290 | 291 | -- Expansions are idempotent, XExprs do not expand again
|
| 291 | 292 | tcExpand (XExpr (ExpandedThingRn hse))
|
| 292 | 293 | = return $ Just hse
|
| ... | ... | @@ -767,6 +767,11 @@ tcExprNoExpand (ArithSeq _ witness seq) res_ty |
| 767 | 767 | tcExprNoExpand (HsTypedSplice ext splice) res_ty = tcTypedSplice ext splice res_ty
|
| 768 | 768 | tcExprNoExpand e@(HsTypedBracket _ext body) res_ty = tcTypedBracket e body res_ty
|
| 769 | 769 | tcExprNoExpand e@(HsUntypedBracket ps body) res_ty = tcUntypedBracket e body ps res_ty
|
| 770 | +tcExprNoExpand (XExpr (ReSynBindsRn m e)) res_ty
|
|
| 771 | + = do { traceTc "XExpr ReSynBinds" (text "module:" <+> ppr m)
|
|
| 772 | + ; e' <- tcExpr e res_ty
|
|
| 773 | + ; return $ XExpr (ReSynBindsTc m e')
|
|
| 774 | + }
|
|
| 770 | 775 | |
| 771 | 776 | {-
|
| 772 | 777 | ************************************************************************
|
| ... | ... | @@ -713,7 +713,14 @@ tcTypedBracket rn_expr expr res_ty |
| 713 | 713 | ; ps' <- readMutVar ps_var
|
| 714 | 714 | ; codeco <- tcLookupKnownOccId unsafeCodeCoerceOcc
|
| 715 | 715 | ; bracket_ty <- mkAppTy m_var <$> tcMetaKnownOccTy expTyConOcc
|
| 716 | - ; let brack_tc = HsBracketTc { hsb_quote = ExpBr noExtField expr, hsb_ty = bracket_ty
|
|
| 716 | + -- wrap the expression with ReSynBinds if rebindable syntax is on in this module
|
|
| 717 | + ; isRebindableSyntaxOn <- xoptM LangExt.RebindableSyntax
|
|
| 718 | + ; mname <- moduleName <$> getModule
|
|
| 719 | + ; let expr' = if isRebindableSyntaxOn
|
|
| 720 | + then case expr of { L loc e -> L loc (XExpr $ ReSynBindsRn (toHsModuleName mname) e) }
|
|
| 721 | + else expr
|
|
| 722 | + ; traceTc "tc_bracket rebindable wrap" (vcat [ppr isRebindableSyntaxOn, ppr mname])
|
|
| 723 | + ; let brack_tc = HsBracketTc { hsb_quote = ExpBr noExtField expr', hsb_ty = bracket_ty
|
|
| 717 | 724 | , hsb_wrap = Just wrapper, hsb_splices = ps' }
|
| 718 | 725 | -- The tc_expr is stored here so that the expression can be used in HIE files.
|
| 719 | 726 | brack_expr = HsTypedBracket brack_tc tc_expr
|
| ... | ... | @@ -639,6 +639,7 @@ exprCtOrigin (RecordUpd{}) = RecordUpdOrigin |
| 639 | 639 | exprCtOrigin (HsGetField _ _ f) = GetFieldOrigin (fmap (mkFastStringShortText . field_label) $ dfoLabel (unLoc f))
|
| 640 | 640 | exprCtOrigin (XExpr (ExpandedThingRn (HSE o _))) = hsCtxtCtOrigin o
|
| 641 | 641 | exprCtOrigin (XExpr (HsRecSelRn f)) = OccurrenceOfRecSel $ L (getLoc $ foLabel f) (foExt f)
|
| 642 | +exprCtOrigin (XExpr (ReSynBindsRn _ e)) = exprCtOrigin e
|
|
| 642 | 643 | |
| 643 | 644 | hsCtxtCtOrigin :: HsCtxt -> CtOrigin
|
| 644 | 645 | hsCtxtCtOrigin (ExprCtxt (ExprWithTySig _ (L _ e) _)) = exprCtOrigin e
|
| ... | ... | @@ -1096,6 +1096,10 @@ zonkExpr (XExpr (HsRecSelTc (FieldOcc occ (L l v)))) |
| 1096 | 1096 | = do { v' <- zonkIdOcc v
|
| 1097 | 1097 | ; return (XExpr (HsRecSelTc (FieldOcc occ (L l v')))) }
|
| 1098 | 1098 | |
| 1099 | +zonkExpr (XExpr (ReSynBindsTc m e))
|
|
| 1100 | + = do e' <- zonkExpr e
|
|
| 1101 | + return $ (XExpr (ReSynBindsTc m e'))
|
|
| 1102 | + |
|
| 1099 | 1103 | zonkExpr (RecordUpd x _ _) = dataConCantHappen x
|
| 1100 | 1104 | zonkExpr (HsGetField x _ _) = dataConCantHappen x
|
| 1101 | 1105 | zonkExpr (HsProjection x _) = dataConCantHappen x
|
| ... | ... | @@ -1229,7 +1229,7 @@ cvtl e = wrapLA (cvt e) |
| 1229 | 1229 | mkHsForAllVisTele noAnn tvs'
|
| 1230 | 1230 | ; return $ HsForAll noExtField tele body' }
|
| 1231 | 1231 | cvt (ReSynBindsE m e) = do { e' <- cvt e
|
| 1232 | - ; return $ XExpr (ReSynBinds (mk_modtext m) e') }
|
|
| 1232 | + ; return $ XExpr (ReSynBindsPs (mk_modtext m) e') }
|
|
| 1233 | 1233 | |
| 1234 | 1234 | {- | #16895 Ensure an infix expression's operator is a variable/constructor.
|
| 1235 | 1235 | Consider this example:
|
| ... | ... | @@ -438,6 +438,8 @@ forallVisE tvars body = ForallVisE <$> sequenceA tvars <*> body |
| 438 | 438 | constrainedE :: Quote m => [m Exp] -> m Exp -> m Exp
|
| 439 | 439 | constrainedE ctx body = ConstrainedE <$> sequenceA ctx <*> body
|
| 440 | 440 | |
| 441 | +reSynBindsE :: Quote m => ModName -> m Exp -> m Exp
|
|
| 442 | +reSynBindsE m e = ReSynBindsE m <$> e
|
|
| 441 | 443 | -------------------------------------------------------------------------------
|
| 442 | 444 | -- * Dec
|
| 443 | 445 |