diff options
Diffstat (limited to 'compiler/GHC/HsToCore/Match.hs')
-rw-r--r-- | compiler/GHC/HsToCore/Match.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/Match.hs b/compiler/GHC/HsToCore/Match.hs index 6b0ea1f12d..f0e2643613 100644 --- a/compiler/GHC/HsToCore/Match.hs +++ b/compiler/GHC/HsToCore/Match.hs @@ -371,6 +371,7 @@ Among other things in the resulting Pattern: The bindings created by the above patterns are put into the returned wrapper instead. +-- ROMES:TODO: Do something about this, lambda bound can become let bound for irrefutable patterns This means a definition of the form: f x = rhs when called with v get's desugared to the equivalent of: @@ -825,8 +826,9 @@ matchWrapper ctxt scrs (MG { mg_alts = L _ matches $ replicate (length (grhssGRHSs m)) initNablas +-- No wait, doesn't seem quite right? -- | Matching will turn a group of pattern-matching equations and MatchId's --- into a group of case expressions +-- into a case expression -- -- For example: -- @@ -840,6 +842,8 @@ matchWrapper ctxt scrs (MG { mg_alts = L _ matches -- (x:xs) -> case ys' of -- [] -> [] -- (y:ys) -> f x y : mappairs f xs ys +-- +-- See also 'match' matchEquations :: HasCallStack => HsMatchContext GhcRn -> [MatchId] -> [EquationInfo] -> Type -> DsM CoreExpr @@ -970,7 +974,7 @@ groupEquations :: Platform -> [EquationInfo] -> [NonEmpty (PatGroup, EquationInf -- (b) none of the gi are empty -- The ordering of equations is unchanged groupEquations platform eqns - = NEL.groupBy same_gp $ [(patGroup platform (firstPat eqn), eqn) | eqn <- eqns] + = NEL.groupBy same_gp $ [pprTrace "groupEquations" (ppr (firstPat eqn)) $! (patGroup platform (firstPat eqn), eqn) | eqn <- eqns] -- comprehension on NonEmpty where same_gp :: (PatGroup,EquationInfo) -> (PatGroup,EquationInfo) -> Bool |