Refactor to combine HsLam and HsLamCase
This MR is pure refactoring (#23916): * Combine `HsLam` and `HsLamCase` * Combine `HsCmdLam` and `HsCmdLamCase` This just arranges to treat uniformly \x -> e \case pi -> ei \cases pis -> ie In the exising code base the first is treated differently to the latter two. No change in behaviour. More specifics: * Combine `HsLam` and `HsLamCase` (constructors of `Language.Haskell.Syntax.Expr.HsExpr`) into one data construtor covering * Lambda * `\case` * `\cases` * The new `HsLam` has an argument of type `HsLamVariant` to distinguish the three cases. * Similarly, combine `HsCmdLam` and `HsCmdLamCase` (constructors of `Language.Haskell.Syntax.Expr.HsCmd` ) into one. * Similarly, combine `mkHsLamPV` and `mkHsLamCasePV` (methods of class `DisambECP`) into one. (Thank you Alan Zimmerman.) * Similarly, combine `LambdaExpr` and `LamCaseAlt` (constructors of `Language.Haskell.Syntax.Expr.HsMatchContext`) into one: `LamAlt` with a `HsLamVariant` argument. * Similarly, combine `KappaExpr` and `ArrowLamCaseAlt` (constructors of `Language.Haskell.Syntax.Expr.HsArrowMatchContext`) into one: `ArrowLamAlt` with a `HsLamVariant` argument. * Similarly, combine `PsErrLambdaInPat` and `PsErrLambdaCaseInPat` (constructors of `GHC.Parser.Errors.Ppr.PsError`) into one. * Similarly, combine `PsErrLambdaInPat` and `PsErrLambdaCaseInPat` (constructors of `GHC.Parser.Errors.Ppr.PsError`) into one. * In the same `PsError` data type, combine `PsErrLambdaCmdInFunAppCmd` and `PsErrLambdaCaseCmdInFunAppCmd` into one. * In the same `PsError` data tpye, combine `PsErrLambdaInFunAppExpr` and `PsErrLambdaCaseInFunAppExpr` into one. p* Smilarly combine `ExpectedFunTyLam` and `ExpectedFunTyLamCase` (constructors of `GHC.Tc.Types.Origin.ExpectedFunTyOrigin`) into one. Phew!
Showing
- compiler/GHC/Hs/Expr.hs 51 additions, 64 deletionscompiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Syn/Type.hs 1 addition, 2 deletionscompiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs 6 additions, 6 deletionscompiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs 13 additions, 14 deletionscompiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Expr.hs 4 additions, 7 deletionscompiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs 6 additions, 6 deletionscompiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Quote.hs 4 additions, 4 deletionscompiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs 3 additions, 7 deletionscompiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs 2 additions, 8 deletionscompiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser.y 15 additions, 11 deletionscompiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs 10 additions, 24 deletionscompiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs 6 additions, 15 deletionscompiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/PostProcess.hs 37 additions, 42 deletionscompiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Bind.hs 2 additions, 2 deletionscompiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs 10 additions, 20 deletionscompiler/GHC/Rename/Expr.hs
- compiler/GHC/Tc/Errors/Ppr.hs 11 additions, 11 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Arrow.hs 12 additions, 17 deletionscompiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Expr.hs 5 additions, 13 deletionscompiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Match.hs 9 additions, 3 deletionscompiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs 2 additions, 2 deletionscompiler/GHC/Tc/TyCl/PatSyn.hs
Loading
Please register or sign in to comment