GHC.Tc.Gen.Match

ghc-9.2.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Tc.Gen.Match

Description

Typecheck some `Matches`

# Documentation

tcMatchesFun :: LocatedN Name -> MatchGroup GhcRn (LHsExpr GhcRn) -> ExpRhoType -> TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc)) Source #

tcGRHS :: TcMatchCtxt body -> ExpRhoType -> GRHS GhcRn (LocatedA (body GhcRn)) -> TcM (GRHS GhcTc (LocatedA (body GhcTc))) Source #

tcGRHSsPat :: GRHSs GhcRn (LHsExpr GhcRn) -> ExpRhoType -> TcM (GRHSs GhcTc (LHsExpr GhcTc)) Source #

tcMatchesCase :: AnnoBody body => TcMatchCtxt body -> Scaled TcSigmaType -> MatchGroup GhcRn (LocatedA (body GhcRn)) -> ExpRhoType -> TcM (MatchGroup GhcTc (LocatedA (body GhcTc))) Source #

tcMatchLambda :: SDoc -> TcMatchCtxt HsExpr -> MatchGroup GhcRn (LHsExpr GhcRn) -> ExpRhoType -> TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc)) Source #

data TcMatchCtxt body Source #

Constructors

MC |
Fields mc_what :: HsMatchContext GhcRn mc_body :: LocatedA (body GhcRn) -> ExpRhoType -> TcM (LocatedA (body GhcTc))

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

type TcExprStmtChecker = TcStmtChecker HsExpr ExpRhoType Source #

type TcCmdStmtChecker = TcStmtChecker HsCmd TcRhoType Source #

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

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

tcDoStmts :: HsStmtContext GhcRn -> LocatedL [LStmt GhcRn (LHsExpr GhcRn)] -> ExpRhoType -> TcM (HsExpr GhcTc) Source #

tcBody :: LHsExpr GhcRn -> ExpRhoType -> TcM (LHsExpr GhcTc) Source #

tcDoStmt :: TcExprStmtChecker Source #

tcGuardStmt :: TcExprStmtChecker Source #