ghc-lib-9.10.1.20241103: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.Tc.Gen.Match

Description

Typecheck some Matches

Synopsis

Documentation

tcCaseMatches Source #

Arguments

:: (AnnoBody body, Outputable (body GhcTc)) 
=> TcMatchAltChecker body

Typecheck the alternative RHSS

-> Scaled TcSigmaTypeFRR

Type of scrutinee

-> MatchGroup GhcRn (LocatedA (body GhcRn))

The case alternatives

-> ExpRhoType

Type of the whole case expression

-> TcM (HsWrapper, MatchGroup GhcTc (LocatedA (body GhcTc))) 

tcGRHSList :: forall body. AnnoBody body => HsMatchContextRn -> TcMatchAltChecker body -> [LGRHS GhcRn (LocatedA (body GhcRn))] -> ExpRhoType -> TcM [LGRHS GhcTc (LocatedA (body GhcTc))] Source #

type TcStmtChecker body rho_type = forall thing. HsStmtContextRn -> Stmt GhcRn (LocatedA (body GhcRn)) -> rho_type -> (rho_type -> TcM thing) -> TcM (Stmt GhcTc (LocatedA (body GhcTc)), thing) Source #

tcStmts :: AnnoBody body => HsStmtContextRn -> TcStmtChecker body rho_type -> [LStmt GhcRn (LocatedA (body GhcRn))] -> rho_type -> TcM [LStmt GhcTc (LocatedA (body GhcTc))] Source #

tcStmtsAndThen :: AnnoBody body => HsStmtContextRn -> TcStmtChecker body rho_type -> [LStmt GhcRn (LocatedA (body GhcRn))] -> rho_type -> (rho_type -> TcM thing) -> TcM ([LStmt GhcTc (LocatedA (body GhcTc))], thing) Source #

checkArgCounts :: AnnoBody body => MatchGroup GhcRn (LocatedA (body GhcRn)) -> TcM VisArity Source #

checkArgCounts takes a [RenamedMatch] and decides whether the same number of required args are used in each equation. Returns the arity, the number of required args E.g. f @a True y = ... f False z = ... The MatchGroup for f has arity 2, not 3