Match

ghc-8.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

Match

# Documentation

match #

Arguments

:: [MatchId] | Variables rep'ing the exprs we're matching with ^ See Note [Match Ids]
-> Type | Type of the case expression
-> [EquationInfo] | Info about patterns, etc. (type synonym below)
-> DsM MatchResult | Desugared result!

matchEquations :: HsMatchContext Name -> [MatchId] -> [EquationInfo] -> Type -> DsM CoreExpr #

matchWrapper #

Arguments

:: HsMatchContext Name | For shadowing warning messages
-> Maybe (LHsExpr GhcTc) | Scrutinee. (Just scrut) for a case expr case scrut of { p1 -> e1 ... } (and in this case the MatchGroup will have all singleton patterns) Nothing for a function definition f p1 q1 = ... -- No "scrutinee" f p2 q2 = ... -- in this case
-> MatchGroup GhcTc (LHsExpr GhcTc) | Matches being desugared
-> DsM ([Id], CoreExpr) | Results (usually passed to `match`)

matchSimply #

Arguments

:: CoreExpr | Scrutinee
-> HsMatchContext Name | Match kind
-> LPat GhcTc | Pattern it should match
-> CoreExpr | Return this if it matches
-> CoreExpr | Return this if it doesn't
-> DsM CoreExpr |

matchSinglePat :: CoreExpr -> HsMatchContext Name -> LPat GhcTc -> Type -> MatchResult -> DsM MatchResult #

matchSinglePatVar :: Id -> HsMatchContext Name -> LPat GhcTc -> Type -> MatchResult -> DsM MatchResult #