Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
5861 commits behind the upstream repository.
Simon Peyton Jones's avatar
Simon Peyton Jones authored
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!
ef5342cd
History
Name Last commit Last update
..
.gitignore
AnnotationLet.hs
AnnotationTuple.hs
BundleExport.hs
CommentsTest.hs
HsDocTy.hs
InTreeAnnotations1.hs
ListComprehensions.hs
Makefile
Ppr001.hs
Ppr002.hs
Ppr002a.hs
Ppr003.hs
Ppr004.hs
Ppr005.hs
Ppr006.hs
Ppr007.hs
Ppr008.hs
Ppr009.hs
Ppr010.hs
Ppr011.hs
Ppr012.hs
Ppr013.hs
Ppr014.hs
Ppr015.hs
Ppr016.hs
Ppr017.hs
Ppr018.hs
Ppr019.hs
Ppr020.hs
Ppr021.hs
Ppr022.hs
Ppr023.hs
Ppr024.hs
Ppr025.hs
Ppr026.hs
Ppr027.hs
Ppr028.hs
Ppr029.hs
Ppr030.hs
Ppr031.hs
Ppr032.hs
Ppr033.hs
Ppr034.hs
Ppr035.hs
Ppr036.hs
Ppr037.hs
Ppr038.hs
Ppr039.hs
Ppr040.hs
Ppr041.hs
Ppr042.hs
Ppr043.hs
Ppr044.hs
Ppr045.hs
Ppr046.hs
Ppr048.hs
Ppr049.hs
Ppr050.hs
Ppr051.hs
Ppr052.hs
Ppr053.hs
Ppr054.hs
Ppr055.hs
PprArrowLambdaCase.hs
PprArrows.hs
PprBracesSemiDataDecl.hs
PprClassParens.hs
PprClassTypeFamily.hs
PprCommentPlacement2.hs
PprCommentsOnly.hs
PprCompleteSig.hs
PprDynamic.hs
PprEmptyMostly.hs
PprEmptyMostlyInst.hs
PprExportWarn.hs
PprForeignDecl.hs
PprInstanceWarn.hs
PprLinearArrow.hs
PprOverloadedLabels.hs
PprOverloadedRecords.hs
PprParenFunBind.hs
PprRecordDotSyntax1.hs
PprRecordDotSyntax2.hs
PprRecordDotSyntax3.hs
PprRecordDotSyntax4.hs
PprRecordDotSyntaxA.hs
PprRecordSemi.hs
PprRecursiveDo.hs
PprRoles.hs
PprSemis.hs
PprT13747.hs
PprThAbstractFamily.hs
PprTypeBrackets.hs
PprTypeSynParens.hs
PprUnicodeSyntax.hs
RdrNames.hs
StarBinderAnns.hs
T13050p.hs
T13199.hs