ghc-9.8.0.20230919: The GHC API
Safe HaskellNone
LanguageHaskell2010

GHC.Tc.Gen.Match

Description

Typecheck some Matches

Synopsis

Documentation

tcMatchesCase Source #

Arguments

:: AnnoBody body 
=> TcMatchCtxt body

Case context

-> Scaled TcSigmaTypeFRR

Type of scrutinee

-> MatchGroup GhcRn (LocatedA (body GhcRn))

The case alternatives

-> ExpRhoType

Type of the whole case expression

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

data TcMatchCtxt (body :: Type -> Type) Source #

Constructors

MC 

type TcStmtChecker (body :: Type -> Type) rho_type = forall thing. HsStmtContext GhcTc -> 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 => HsStmtContext GhcTc -> 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 => HsStmtContext GhcTc -> 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 => HsMatchContext GhcTc -> MatchGroup GhcRn (LocatedA (body GhcRn)) -> TcM () Source #

checkArgCounts takes a [RenamedMatch] and decides whether the same number of args are used in each equation.