Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- match :: [MatchId] -> Type -> [EquationInfo] -> DsM (MatchResult CoreExpr)
- matchEquations :: HsMatchContextRn -> [MatchId] -> [EquationInfo] -> Type -> DsM CoreExpr
- matchWrapper :: HsMatchContextRn -> Maybe [LHsExpr GhcTc] -> MatchGroup GhcTc (LHsExpr GhcTc) -> DsM ([Id], CoreExpr)
- matchSimply :: CoreExpr -> HsMatchContextRn -> Mult -> LPat GhcTc -> CoreExpr -> CoreExpr -> DsM CoreExpr
- matchSinglePat :: CoreExpr -> HsMatchContextRn -> LPat GhcTc -> Mult -> Type -> MatchResult CoreExpr -> DsM (MatchResult CoreExpr)
- matchSinglePatVar :: Id -> Maybe CoreExpr -> HsMatchContextRn -> LPat GhcTc -> Type -> MatchResult CoreExpr -> DsM (MatchResult CoreExpr)
Documentation
:: [MatchId] | Variables rep'ing the exprs we're matching with ^ See Note [Match Ids] ^ Note that the Match Ids carry not only a name, but ^ also the multiplicity at which each column has been ^ type checked. |
-> Type | Type of the case expression |
-> [EquationInfo] | Info about patterns, etc. (type synonym below) |
-> DsM (MatchResult CoreExpr) | Desugared result! |
matchEquations :: HsMatchContextRn -> [MatchId] -> [EquationInfo] -> Type -> DsM CoreExpr Source #
:: CoreExpr | Scrutinee |
-> HsMatchContextRn | Match kind |
-> Mult | Scaling factor of the case expression |
-> LPat GhcTc | Pattern it should match |
-> CoreExpr | Return this if it matches |
-> CoreExpr | Return this if it doesn't |
-> DsM CoreExpr |
matchSimply
is a wrapper for match
which deals with the
situation where we want to match a single expression against a single
pattern. It returns an expression.
matchSinglePat :: CoreExpr -> HsMatchContextRn -> LPat GhcTc -> Mult -> Type -> MatchResult CoreExpr -> DsM (MatchResult CoreExpr) Source #
:: Id | |
-> Maybe CoreExpr | The scrutinee the match id is bound to |
-> HsMatchContextRn | |
-> LPat GhcTc | |
-> Type | |
-> MatchResult CoreExpr | |
-> DsM (MatchResult CoreExpr) |