ghc-9.12: The GHC API
Safe HaskellNone
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 :: AnnoBody body => HsMatchContextRn -> TcMatchAltChecker body -> [LGRHS GhcRn (LocatedA (body GhcRn))] -> ExpRhoType -> TcM [LGRHS GhcTc (LocatedA (body GhcTc))] Source #

type TcStmtChecker (body :: Type -> Type) 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 :: forall (body :: Type -> Type) rho_type. AnnoBody body => HsStmtContextRn -> TcStmtChecker body rho_type -> [LStmt GhcRn (LocatedA (body GhcRn))] -> rho_type -> TcM [LStmt GhcTc (LocatedA (body GhcTc))] Source #

tcStmtsAndThen :: forall (body :: Type -> Type) rho_type thing. 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 (aka visible) 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