GHC.Tc.Gen.Match

ghc-9.0.0.20201227: The GHC API

Safe Haskell | None
Language | Haskell2010

GHC.Tc.Gen.Match

Description

Typecheck some `Matches`

# Documentation

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

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

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

tcMatchesCase :: Outputable (body GhcRn) => TcMatchCtxt body -> Scaled TcSigmaType -> MatchGroup GhcRn (Located (body GhcRn)) -> ExpRhoType -> TcM (MatchGroup GhcTc (Located (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 :: Located (body GhcRn) -> ExpRhoType -> TcM (Located (body GhcTc))

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

type TcExprStmtChecker = TcStmtChecker HsExpr ExpRhoType Source #

type TcCmdStmtChecker = TcStmtChecker HsCmd TcRhoType Source #

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

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

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

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

tcDoStmt :: TcExprStmtChecker Source #

tcGuardStmt :: TcExprStmtChecker Source #