Commit 410bd197 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Marge Bot

Expunge GhcTcId

GHC.Hs.Extension had

  type GhcPs   = GhcPass 'Parsed
  type GhcRn   = GhcPass 'Renamed
  type GhcTc   = GhcPass 'Typechecked
  type GhcTcId = GhcTc

The last of these, GhcTcId, is a vestige of the past.

This patch expunges it from GHC.
parent 9908a68d
Pipeline #20289 failed with stages
in 729 minutes and 36 seconds
......@@ -94,7 +94,7 @@ data Hooks = Hooks
, tcForeignImportsHook :: Maybe ([LForeignDecl GhcRn]
-> TcM ([Id], [LForeignDecl GhcTc], Bag GlobalRdrElt))
, tcForeignExportsHook :: Maybe ([LForeignDecl GhcRn]
-> TcM (LHsBinds GhcTcId, [LForeignDecl GhcTcId], Bag GlobalRdrElt))
-> TcM (LHsBinds GhcTc, [LForeignDecl GhcTc], Bag GlobalRdrElt))
, hscFrontendHook :: Maybe (ModSummary -> Hsc FrontendResult)
, hscCompileCoreExprHook ::
Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO ForeignHValue)
......
......@@ -2477,7 +2477,7 @@ data DelayedSplice =
TcLclEnv -- The local environment to run the splice in
(LHsExpr GhcRn) -- The original renamed expression
TcType -- The result type of running the splice, unzonked
(LHsExpr GhcTcId) -- The typechecked expression to run and splice in the result
(LHsExpr GhcTc) -- The typechecked expression to run and splice in the result
-- A Data instance which ignores the argument of 'DelayedSplice'.
instance Data DelayedSplice where
......
......@@ -222,10 +222,9 @@ data Pass = Parsed | Renamed | Typechecked
deriving (Data)
-- Type synonyms as a shorthand for tagging
type GhcPs = GhcPass 'Parsed -- Old 'RdrName' type param
type GhcRn = GhcPass 'Renamed -- Old 'Name' type param
type GhcTc = GhcPass 'Typechecked -- Old 'Id' type para,
type GhcTcId = GhcTc -- Old 'TcId' type param
type GhcPs = GhcPass 'Parsed -- Output of parser
type GhcRn = GhcPass 'Renamed -- Output of renamer
type GhcTc = GhcPass 'Typechecked -- Output of typechecker
-- | Allows us to check what phase we're in at GHC's runtime.
-- For example, this class allows us to write
......
......@@ -647,7 +647,7 @@ dsInnerMonadComp stmts bndrs ret_op
-- , fmap (selN2 :: (t1, t2) -> t2) ys )
mkMcUnzipM :: TransForm
-> HsExpr GhcTcId -- fmap
-> HsExpr GhcTc -- fmap
-> Id -- Of type n (a,b,c)
-> [Type] -- [a,b,c] (not levity-polymorphic)
-> DsM CoreExpr -- Of type (n a, n b, n c)
......
......@@ -83,7 +83,7 @@ Note that
tcProc :: LPat GhcRn -> LHsCmdTop GhcRn -- proc pat -> expr
-> ExpRhoType -- Expected type of whole proc expression
-> TcM (LPat GhcTc, LHsCmdTop GhcTcId, TcCoercion)
-> TcM (LPat GhcTc, LHsCmdTop GhcTc, TcCoercion)
tcProc pat cmd exp_ty
= newArrowScope $
......@@ -121,7 +121,7 @@ mkCmdArrTy env t1 t2 = mkAppTys (cmd_arr env) [t1, t2]
tcCmdTop :: CmdEnv
-> LHsCmdTop GhcRn
-> CmdType
-> TcM (LHsCmdTop GhcTcId)
-> TcM (LHsCmdTop GhcTc)
tcCmdTop env (L loc (HsCmdTop names cmd)) cmd_ty@(cmd_stk, res_ty)
= setSrcSpan loc $
......@@ -130,14 +130,14 @@ tcCmdTop env (L loc (HsCmdTop names cmd)) cmd_ty@(cmd_stk, res_ty)
; return (L loc $ HsCmdTop (CmdTopTc cmd_stk res_ty names') cmd') }
----------------------------------------
tcCmd :: CmdEnv -> LHsCmd GhcRn -> CmdType -> TcM (LHsCmd GhcTcId)
tcCmd :: CmdEnv -> LHsCmd GhcRn -> CmdType -> TcM (LHsCmd GhcTc)
-- The main recursive function
tcCmd env (L loc cmd) res_ty
= setSrcSpan loc $ do
{ cmd' <- tc_cmd env cmd res_ty
; return (L loc cmd') }
tc_cmd :: CmdEnv -> HsCmd GhcRn -> CmdType -> TcM (HsCmd GhcTcId)
tc_cmd :: CmdEnv -> HsCmd GhcRn -> CmdType -> TcM (HsCmd GhcTc)
tc_cmd env (HsCmdPar x cmd) res_ty
= do { cmd' <- tcCmd env cmd res_ty
; return (HsCmdPar x cmd') }
......@@ -314,7 +314,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty)
; return (HsCmdArrForm x expr' f fixity cmd_args') }
where
tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTcId, TcType)
tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType)
tc_cmd_arg cmd
= do { arr_ty <- newFlexiTyVarTy arrowTyConKind
; stk_ty <- newFlexiTyVarTy liftedTypeKind
......@@ -337,7 +337,7 @@ tcCmdMatches :: CmdEnv
-> TcType -- ^ type of the scrutinee
-> MatchGroup GhcRn (LHsCmd GhcRn) -- ^ case alternatives
-> CmdType
-> TcM (MatchGroup GhcTcId (LHsCmd GhcTcId))
-> TcM (MatchGroup GhcTc (LHsCmd GhcTc))
tcCmdMatches env scrut_ty matches (stk, res_ty)
= tcMatchesCase match_ctxt scrut_ty matches (mkCheckExpType res_ty)
where
......@@ -421,7 +421,7 @@ tcArrDoStmt env ctxt (RecStmt { recS_stmts = stmts, recS_later_ids = later_names
tcArrDoStmt _ _ stmt _ _
= pprPanic "tcArrDoStmt: unexpected Stmt" (ppr stmt)
tc_arr_rhs :: CmdEnv -> LHsCmd GhcRn -> TcM (LHsCmd GhcTcId, TcType)
tc_arr_rhs :: CmdEnv -> LHsCmd GhcRn -> TcM (LHsCmd GhcTc, TcType)
tc_arr_rhs env rhs = do { ty <- newFlexiTyVarTy liftedTypeKind
; rhs' <- tcCmd env rhs (unitTy, ty)
; return (rhs', ty) }
......
......@@ -321,7 +321,7 @@ badBootDeclErr = text "Illegal declarations in an hs-boot file"
------------------------
tcLocalBinds :: HsLocalBinds GhcRn -> TcM thing
-> TcM (HsLocalBinds GhcTcId, thing)
-> TcM (HsLocalBinds GhcTc, thing)
tcLocalBinds (EmptyLocalBinds x) thing_inside
= do { thing <- thing_inside
......@@ -382,7 +382,7 @@ untouchable-range idea.
tcValBinds :: TopLevelFlag
-> [(RecFlag, LHsBinds GhcRn)] -> [LSig GhcRn]
-> TcM thing
-> TcM ([(RecFlag, LHsBinds GhcTcId)], thing)
-> TcM ([(RecFlag, LHsBinds GhcTc)], thing)
tcValBinds top_lvl binds sigs thing_inside
= do { -- Typecheck the signatures
......@@ -412,7 +412,7 @@ tcValBinds top_lvl binds sigs thing_inside
------------------------
tcBindGroups :: TopLevelFlag -> TcSigFun -> TcPragEnv
-> [(RecFlag, LHsBinds GhcRn)] -> TcM thing
-> TcM ([(RecFlag, LHsBinds GhcTcId)], thing)
-> TcM ([(RecFlag, LHsBinds GhcTc)], thing)
-- Typecheck a whole lot of value bindings,
-- one strongly-connected component at a time
-- Here a "strongly connected component" has the straightforward
......@@ -453,7 +453,7 @@ tcBindGroups top_lvl sig_fn prag_fn (group : groups) thing_inside
tc_group :: forall thing.
TopLevelFlag -> TcSigFun -> TcPragEnv
-> (RecFlag, LHsBinds GhcRn) -> IsGroupClosed -> TcM thing
-> TcM ([(RecFlag, LHsBinds GhcTcId)], thing)
-> TcM ([(RecFlag, LHsBinds GhcTc)], thing)
-- Typecheck one strongly-connected component of the original program.
-- We get a list of groups back, because there may
......@@ -491,7 +491,7 @@ tc_group top_lvl sig_fn prag_fn (Recursive, binds) closed thing_inside
sccs :: [SCC (LHsBind GhcRn)]
sccs = stronglyConnCompFromEdgedVerticesUniq (mkEdges sig_fn binds)
go :: [SCC (LHsBind GhcRn)] -> TcM (LHsBinds GhcTcId, thing)
go :: [SCC (LHsBind GhcRn)] -> TcM (LHsBinds GhcTc, thing)
go (scc:sccs) = do { (binds1, ids1) <- tc_scc scc
; (binds2, thing) <- tcExtendLetEnv top_lvl sig_fn
closed ids1 $
......@@ -523,7 +523,7 @@ recursivePatSynErr loc binds
tc_single :: forall thing.
TopLevelFlag -> TcSigFun -> TcPragEnv
-> LHsBind GhcRn -> IsGroupClosed -> TcM thing
-> TcM (LHsBinds GhcTcId, thing)
-> TcM (LHsBinds GhcTc, thing)
tc_single _top_lvl sig_fn _prag_fn
(L _ (PatSynBind _ psb@PSB{ psb_id = L _ name }))
_ thing_inside
......@@ -574,7 +574,7 @@ tcPolyBinds :: TcSigFun -> TcPragEnv
-- dependencies based on type signatures
-> IsGroupClosed -- Whether the group is closed
-> [LHsBind GhcRn] -- None are PatSynBind
-> TcM (LHsBinds GhcTcId, [TcId])
-> TcM (LHsBinds GhcTc, [TcId])
-- Typechecks a single bunch of values bindings all together,
-- and generalises them. The bunch may be only part of a recursive
......@@ -618,7 +618,7 @@ tcPolyBinds sig_fn prag_fn rec_group rec_tc closed bind_list
-- If typechecking the binds fails, then return with each
-- signature-less binder given type (forall a.a), to minimise
-- subsequent error messages
recoveryCode :: [Name] -> TcSigFun -> TcM (LHsBinds GhcTcId, [Id])
recoveryCode :: [Name] -> TcSigFun -> TcM (LHsBinds GhcTc, [Id])
recoveryCode binder_names sig_fn
= do { traceTc "tcBindsWithSigs: error recovery" (ppr binder_names)
; let poly_ids = map mk_dummy binder_names
......@@ -651,7 +651,7 @@ tcPolyNoGen -- No generalisation whatsoever
-- dependencies based on type signatures
-> TcPragEnv -> TcSigFun
-> [LHsBind GhcRn]
-> TcM (LHsBinds GhcTcId, [TcId])
-> TcM (LHsBinds GhcTc, [TcId])
tcPolyNoGen rec_tc prag_fn tc_sig_fn bind_list
= do { (binds', mono_infos) <- tcMonoBinds rec_tc tc_sig_fn
......@@ -678,7 +678,7 @@ tcPolyNoGen rec_tc prag_fn tc_sig_fn bind_list
tcPolyCheck :: TcPragEnv
-> TcIdSigInfo -- Must be a complete signature
-> LHsBind GhcRn -- Must be a FunBind
-> TcM (LHsBinds GhcTcId, [TcId])
-> TcM (LHsBinds GhcTc, [TcId])
-- There is just one binding,
-- it is a FunBind
-- it has a complete type signature,
......@@ -782,7 +782,7 @@ tcPolyInfer
-> TcPragEnv -> TcSigFun
-> Bool -- True <=> apply the monomorphism restriction
-> [LHsBind GhcRn]
-> TcM (LHsBinds GhcTcId, [TcId])
-> TcM (LHsBinds GhcTc, [TcId])
tcPolyInfer rec_tc prag_fn tc_sig_fn mono bind_list
= do { (tclvl, wanted, (binds', mono_infos))
<- pushLevelAndCaptureConstraints $
......@@ -1250,7 +1250,7 @@ tcMonoBinds :: RecFlag -- Whether the binding is recursive for typechecking pur
-- we are not rescued by a type signature
-> TcSigFun -> LetBndrSpec
-> [LHsBind GhcRn]
-> TcM (LHsBinds GhcTcId, [MonoBindInfo])
-> TcM (LHsBinds GhcTc, [MonoBindInfo])
tcMonoBinds is_rec sig_fn no_gen
[ L b_loc (FunBind { fun_id = L nm_loc name
, fun_matches = matches })]
......@@ -1323,7 +1323,7 @@ tcMonoBinds _ sig_fn no_gen binds
data TcMonoBind -- Half completed; LHS done, RHS not done
= TcFunBind MonoBindInfo SrcSpan (MatchGroup GhcRn (LHsExpr GhcRn))
| TcPatBind [MonoBindInfo] (LPat GhcTcId) (GRHSs GhcRn (LHsExpr GhcRn))
| TcPatBind [MonoBindInfo] (LPat GhcTc) (GRHSs GhcRn (LHsExpr GhcRn))
TcSigmaType
tcLhs :: TcSigFun -> LetBndrSpec -> HsBind GhcRn -> TcM TcMonoBind
......@@ -1414,7 +1414,7 @@ newSigLetBndr no_gen name (TISI { sig_inst_tau = tau })
= newLetBndr no_gen name tau
-------------------
tcRhs :: TcMonoBind -> TcM (HsBind GhcTcId)
tcRhs :: TcMonoBind -> TcM (HsBind GhcTc)
tcRhs (TcFunBind info@(MBI { mbi_sig = mb_sig, mbi_mono_id = mono_id })
loc matches)
= tcExtendIdBinderStackForRhs [info] $
......
......@@ -4,18 +4,18 @@ import GHC.Hs ( HsExpr, LHsExpr, SyntaxExprRn, SyntaxExprTc )
import GHC.Tc.Utils.TcType ( TcRhoType, TcSigmaType, SyntaxOpType, ExpType, ExpRhoType )
import GHC.Tc.Types ( TcM )
import GHC.Tc.Types.Origin ( CtOrigin )
import GHC.Hs.Extension ( GhcRn, GhcTcId )
import GHC.Hs.Extension ( GhcRn, GhcTc )
tcCheckExpr :: LHsExpr GhcRn -> TcSigmaType -> TcM (LHsExpr GhcTcId)
tcCheckExpr :: LHsExpr GhcRn -> TcSigmaType -> TcM (LHsExpr GhcTc)
tcLExpr, tcLExprNC
:: LHsExpr GhcRn -> ExpRhoType -> TcM (LHsExpr GhcTcId)
tcExpr :: HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTcId)
:: LHsExpr GhcRn -> ExpRhoType -> TcM (LHsExpr GhcTc)
tcExpr :: HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc)
tcInferRho, tcInferRhoNC
:: LHsExpr GhcRn-> TcM (LHsExpr GhcTcId, TcRhoType)
:: LHsExpr GhcRn-> TcM (LHsExpr GhcTc, TcRhoType)
tcInferSigma :: LHsExpr GhcRn-> TcM (LHsExpr GhcTcId, TcSigmaType)
tcInferSigma :: LHsExpr GhcRn-> TcM (LHsExpr GhcTc, TcSigmaType)
tcSyntaxOp :: CtOrigin
-> SyntaxExprRn
......@@ -32,4 +32,4 @@ tcSyntaxOpGen :: CtOrigin
-> TcM (a, SyntaxExprTc)
tcCheckId :: Name -> ExpRhoType -> TcM (HsExpr GhcTcId)
tcCheckId :: Name -> ExpRhoType -> TcM (HsExpr GhcTc)
......@@ -367,12 +367,12 @@ checkMissingAmpersand dflags arg_tys res_ty
-}
tcForeignExports :: [LForeignDecl GhcRn]
-> TcM (LHsBinds GhcTcId, [LForeignDecl GhcTcId], Bag GlobalRdrElt)
-> TcM (LHsBinds GhcTc, [LForeignDecl GhcTc], Bag GlobalRdrElt)
tcForeignExports decls =
getHooked tcForeignExportsHook tcForeignExports' >>= ($ decls)
tcForeignExports' :: [LForeignDecl GhcRn]
-> TcM (LHsBinds GhcTcId, [LForeignDecl GhcTcId], Bag GlobalRdrElt)
-> TcM (LHsBinds GhcTc, [LForeignDecl GhcTc], Bag GlobalRdrElt)
-- For the (Bag GlobalRdrElt) result,
-- see Note [Newtype constructor usage in foreign declarations]
tcForeignExports' decls
......
......@@ -90,7 +90,7 @@ See Note [sig_tau may be polymorphic] in GHC.Tc.Gen.Pat.
tcMatchesFun :: Located Name
-> MatchGroup GhcRn (LHsExpr GhcRn)
-> ExpSigmaType -- Expected type of function
-> TcM (HsWrapper, MatchGroup GhcTcId (LHsExpr GhcTcId))
-> TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
-- Returns type of body
tcMatchesFun fn@(L _ fun_name) matches exp_ty
= do { -- Check that they all have the same no of arguments
......@@ -134,7 +134,7 @@ tcMatchesCase :: (Outputable (body GhcRn)) =>
-> TcSigmaType -- Type of scrutinee
-> MatchGroup GhcRn (Located (body GhcRn)) -- The case alternatives
-> ExpRhoType -- Type of whole case expressions
-> TcM (MatchGroup GhcTcId (Located (body GhcTcId)))
-> TcM (MatchGroup GhcTc (Located (body GhcTc)))
-- Translated alternatives
-- wrapper goes from MatchGroup's ty to expected ty
......@@ -145,7 +145,7 @@ tcMatchLambda :: SDoc -- see Note [Herald for matchExpectedFunTys] in GHC.Tc.Uti
-> TcMatchCtxt HsExpr
-> MatchGroup GhcRn (LHsExpr GhcRn)
-> ExpRhoType -- deeply skolemised
-> TcM (MatchGroup GhcTcId (LHsExpr GhcTcId), HsWrapper)
-> TcM (MatchGroup GhcTc (LHsExpr GhcTc), HsWrapper)
tcMatchLambda herald match_ctxt match res_ty
= matchExpectedFunTys herald n_pats res_ty $ \ pat_tys rhs_ty ->
tcMatches match_ctxt pat_tys rhs_ty match
......@@ -156,7 +156,7 @@ tcMatchLambda herald match_ctxt match res_ty
-- @tcGRHSsPat@ typechecks @[GRHSs]@ that occur in a @PatMonoBind@.
tcGRHSsPat :: GRHSs GhcRn (LHsExpr GhcRn) -> TcRhoType
-> TcM (GRHSs GhcTcId (LHsExpr GhcTcId))
-> TcM (GRHSs GhcTc (LHsExpr GhcTc))
-- Used for pattern bindings
tcGRHSsPat grhss res_ty = tcGRHSs match_ctxt grhss (mkCheckExpType res_ty)
where
......@@ -216,14 +216,14 @@ tcMatches :: (Outputable (body GhcRn)) => TcMatchCtxt body
-> [ExpSigmaType] -- Expected pattern types
-> ExpRhoType -- Expected result-type of the Match.
-> MatchGroup GhcRn (Located (body GhcRn))
-> TcM (MatchGroup GhcTcId (Located (body GhcTcId)))
-> TcM (MatchGroup GhcTc (Located (body GhcTc)))
data TcMatchCtxt body -- c.f. TcStmtCtxt, also in this module
= MC { mc_what :: HsMatchContext GhcRn, -- What kind of thing this is
mc_body :: Located (body GhcRn) -- Type checker for a body of
-- an alternative
-> ExpRhoType
-> TcM (Located (body GhcTcId)) }
-> TcM (Located (body GhcTc)) }
tcMatches ctxt pat_tys rhs_ty (MG { mg_alts = L l matches
, mg_origin = origin })
......@@ -242,7 +242,7 @@ tcMatch :: (Outputable (body GhcRn)) => TcMatchCtxt body
-> [ExpSigmaType] -- Expected pattern types
-> ExpRhoType -- Expected result-type of the Match.
-> LMatch GhcRn (Located (body GhcRn))
-> TcM (LMatch GhcTcId (Located (body GhcTcId)))
-> TcM (LMatch GhcTc (Located (body GhcTc)))
tcMatch ctxt pat_tys rhs_ty match
= wrapLocM (tc_match ctxt pat_tys rhs_ty) match
......@@ -265,7 +265,7 @@ tcMatch ctxt pat_tys rhs_ty match
-------------
tcGRHSs :: TcMatchCtxt body -> GRHSs GhcRn (Located (body GhcRn)) -> ExpRhoType
-> TcM (GRHSs GhcTcId (Located (body GhcTcId)))
-> TcM (GRHSs GhcTc (Located (body GhcTc)))
-- Notice that we pass in the full res_ty, so that we get
-- good inference from simple things like
......@@ -282,7 +282,7 @@ tcGRHSs ctxt (GRHSs _ grhss (L l binds)) res_ty
-------------
tcGRHS :: TcMatchCtxt body -> ExpRhoType -> GRHS GhcRn (Located (body GhcRn))
-> TcM (GRHS GhcTcId (Located (body GhcTcId)))
-> TcM (GRHS GhcTc (Located (body GhcTc)))
tcGRHS ctxt res_ty (GRHS _ guards rhs)
= do { (guards', rhs')
......@@ -303,7 +303,7 @@ tcGRHS ctxt res_ty (GRHS _ guards rhs)
tcDoStmts :: HsStmtContext GhcRn
-> Located [LStmt GhcRn (LHsExpr GhcRn)]
-> ExpRhoType
-> TcM (HsExpr GhcTcId) -- Returns a HsDo
-> TcM (HsExpr GhcTc) -- Returns a HsDo
tcDoStmts ListComp (L l stmts) res_ty
= do { res_ty <- expTypeToType res_ty
; (co, elt_ty) <- matchExpectedListTy res_ty
......@@ -329,7 +329,7 @@ tcDoStmts MonadComp (L l stmts) res_ty
tcDoStmts ctxt _ _ = pprPanic "tcDoStmts" (pprStmtContext ctxt)
tcBody :: LHsExpr GhcRn -> ExpRhoType -> TcM (LHsExpr GhcTcId)
tcBody :: LHsExpr GhcRn -> ExpRhoType -> TcM (LHsExpr GhcTc)
tcBody body res_ty
= do { traceTc "tcBody" (ppr res_ty)
; tcLExpr body res_ty
......@@ -351,13 +351,13 @@ type TcStmtChecker body rho_type
-> Stmt GhcRn (Located (body GhcRn))
-> rho_type -- Result type for comprehension
-> (rho_type -> TcM thing) -- Checker for what follows the stmt
-> TcM (Stmt GhcTcId (Located (body GhcTcId)), thing)
-> TcM (Stmt GhcTc (Located (body GhcTc)), thing)
tcStmts :: (Outputable (body GhcRn)) => HsStmtContext GhcRn
-> TcStmtChecker body rho_type -- NB: higher-rank type
-> [LStmt GhcRn (Located (body GhcRn))]
-> rho_type
-> TcM [LStmt GhcTcId (Located (body GhcTcId))]
-> TcM [LStmt GhcTc (Located (body GhcTc))]
tcStmts ctxt stmt_chk stmts res_ty
= do { (stmts', _) <- tcStmtsAndThen ctxt stmt_chk stmts res_ty $
const (return ())
......@@ -368,7 +368,7 @@ tcStmtsAndThen :: (Outputable (body GhcRn)) => HsStmtContext GhcRn
-> [LStmt GhcRn (Located (body GhcRn))]
-> rho_type
-> (rho_type -> TcM thing)
-> TcM ([LStmt GhcTcId (Located (body GhcTcId))], thing)
-> TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
-- Note the higher-rank type. stmt_chk is applied at different
-- types in the equations for tcStmts
......@@ -469,7 +469,7 @@ tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside
; return (ParStmt unitTy pairs' noExpr noSyntaxExpr, thing) }
where
-- loop :: [([LStmt GhcRn], [GhcRn])]
-- -> TcM ([([LStmt GhcTcId], [GhcTcId])], thing)
-- -> TcM ([([LStmt GhcTc], [GhcTc])], thing)
loop [] = do { thing <- thing_inside elt_ty
; return ([], thing) } -- matching in the branches
......@@ -793,7 +793,7 @@ tcMcStmt ctxt (ParStmt _ bndr_stmts_s mzip_op bind_op) res_ty thing_inside
-- -> ExpRhoType -- inner_res_ty
-- -> [TcType] -- tup_tys
-- -> [ParStmtBlock Name]
-- -> TcM ([([LStmt GhcTcId], [GhcTcId])], thing)
-- -> TcM ([([LStmt GhcTc], [TcId])], thing)
loop _ inner_res_ty [] [] = do { thing <- thing_inside inner_res_ty
; return ([], thing) }
-- matching in the branches
......@@ -944,10 +944,10 @@ tcDoStmt _ stmt _ _
-- GHC.Tc.Errors.hs.
tcMonadFailOp :: CtOrigin
-> LPat GhcTcId
-> LPat GhcTc
-> SyntaxExpr GhcRn -- The fail op
-> TcType -- Type of the whole do-expression
-> TcRn (FailOperator GhcTcId) -- Typechecked fail op
-> TcRn (FailOperator GhcTc) -- Typechecked fail op
-- Get a 'fail' operator expression, to use if the pattern match fails.
-- This won't be used in cases where we've already determined the pattern
-- match can't fail (so the fail op is Nothing), however, it seems that the
......@@ -994,7 +994,7 @@ tcApplicativeStmts
-> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
-> ExpRhoType -- rhs_ty
-> (TcRhoType -> TcM t) -- thing_inside
-> TcM ([(SyntaxExpr GhcTcId, ApplicativeArg GhcTcId)], Type, t)
-> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t)
tcApplicativeStmts ctxt pairs rhs_ty thing_inside
= do { body_ty <- newFlexiTyVarTy liftedTypeKind
......@@ -1033,7 +1033,7 @@ tcApplicativeStmts ctxt pairs rhs_ty thing_inside
; return (op' : ops') }
goArg :: Type -> (ApplicativeArg GhcRn, Type, Type)
-> TcM (ApplicativeArg GhcTcId)
-> TcM (ApplicativeArg GhcTc)
goArg body_ty (ApplicativeArgOne
{ xarg_app_arg_one = fail_op
......@@ -1067,7 +1067,7 @@ tcApplicativeStmts ctxt pairs rhs_ty thing_inside
}
; return (ApplicativeArgMany x stmts' ret' pat') }
get_arg_bndrs :: ApplicativeArg GhcTcId -> [Id]
get_arg_bndrs :: ApplicativeArg GhcTc -> [Id]
get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders pat
get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders pat
......
......@@ -5,13 +5,13 @@ import GHC.Types.Name ( Name )
import GHC.Tc.Utils.TcType( ExpSigmaType, TcRhoType )
import GHC.Tc.Types ( TcM )
import GHC.Types.SrcLoc ( Located )
import GHC.Hs.Extension ( GhcRn, GhcTcId )
import GHC.Hs.Extension ( GhcRn, GhcTc )
tcGRHSsPat :: GRHSs GhcRn (LHsExpr GhcRn)
-> TcRhoType
-> TcM (GRHSs GhcTcId (LHsExpr GhcTcId))
-> TcM (GRHSs GhcTc (LHsExpr GhcTc))
tcMatchesFun :: Located Name
-> MatchGroup GhcRn (LHsExpr GhcRn)
-> ExpSigmaType
-> TcM (HsWrapper, MatchGroup GhcTcId (LHsExpr GhcTcId))
-> TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
......@@ -79,7 +79,7 @@ tcLetPat :: (Name -> Maybe TcId)
-> LetBndrSpec
-> LPat GhcRn -> ExpSigmaType
-> TcM a
-> TcM (LPat GhcTcId, a)
-> TcM (LPat GhcTc, a)
tcLetPat sig_fn no_gen pat pat_ty thing_inside
= do { bind_lvl <- getTcLevel
; let ctxt = LetPat { pc_lvl = bind_lvl
......@@ -96,7 +96,7 @@ tcPats :: HsMatchContext GhcRn
-> [LPat GhcRn] -- Patterns,
-> [ExpSigmaType] -- and their types
-> TcM a -- and the checker for the body
-> TcM ([LPat GhcTcId], a)
-> TcM ([LPat GhcTc], a)
-- This is the externally-callable wrapper function
-- Typecheck the patterns, extend the environment to bind the variables,
......@@ -116,7 +116,7 @@ tcPats ctxt pats pat_tys thing_inside
tcInferPat :: HsMatchContext GhcRn -> LPat GhcRn
-> TcM a
-> TcM ((LPat GhcTcId, a), TcSigmaType)
-> TcM ((LPat GhcTc, a), TcSigmaType)
tcInferPat ctxt pat thing_inside
= tcInfer $ \ exp_ty ->
tc_lpat exp_ty penv pat thing_inside
......@@ -126,7 +126,7 @@ tcInferPat ctxt pat thing_inside
tcCheckPat :: HsMatchContext GhcRn
-> LPat GhcRn -> TcSigmaType
-> TcM a -- Checker for body
-> TcM (LPat GhcTcId, a)
-> TcM (LPat GhcTc, a)
tcCheckPat ctxt = tcCheckPat_O ctxt PatOrigin
-- | A variant of 'tcPat' that takes a custom origin
......@@ -134,7 +134,7 @@ tcCheckPat_O :: HsMatchContext GhcRn
-> CtOrigin -- ^ origin to use if the type needs inst'ing
-> LPat GhcRn -> TcSigmaType
-> TcM a -- Checker for body
-> TcM (LPat GhcTcId, a)
-> TcM (LPat GhcTc, a)
tcCheckPat_O ctxt orig pat pat_ty thing_inside
= tc_lpat (mkCheckExpType pat_ty) penv pat thing_inside
where
......@@ -323,7 +323,7 @@ tcMultiple tc_pat penv args thing_inside
--------------------
tc_lpat :: ExpSigmaType
-> Checker (LPat GhcRn) (LPat GhcTcId)
-> Checker (LPat GhcRn) (LPat GhcTc)
tc_lpat pat_ty penv (L span pat) thing_inside
= setSrcSpan span $
do { (pat', res) <- maybeWrapPatCtxt pat (tc_pat pat_ty penv pat)
......@@ -331,7 +331,7 @@ tc_lpat pat_ty penv (L span pat) thing_inside
; return (L span pat', res) }
tc_lpats :: [ExpSigmaType]
-> Checker [LPat GhcRn] [LPat GhcTcId]
-> Checker [LPat GhcRn] [LPat GhcTc]
tc_lpats tys penv pats
= ASSERT2( equalLength pats tys, ppr pats $$ ppr tys )
tcMultiple (\ penv' (p,t) -> tc_lpat t penv' p)
......@@ -341,7 +341,7 @@ tc_lpats tys penv pats
--------------------
tc_pat :: ExpSigmaType
-- ^ Fully refined result type
-> Checker (Pat GhcRn) (Pat GhcTcId)
-> Checker (Pat GhcRn) (Pat GhcTc)
-- ^ Translated pattern
tc_pat pat_ty penv ps_pat thing_inside = case ps_pat of
......@@ -807,7 +807,7 @@ to express the local scope of GADT refinements.
tcConPat :: PatEnv -> Located Name
-> ExpSigmaType -- Type of the pattern
-> HsConPatDetails GhcRn -> TcM a
-> TcM (Pat GhcTcId, a)
-> TcM (Pat GhcTc, a)
tcConPat penv con_lname@(L _ con_name) pat_ty arg_pats thing_inside
= do { con_like <- tcLookupConLike con_name
; case con_like of
......@@ -820,7 +820,7 @@ tcConPat penv con_lname@(L _ con_name) pat_ty arg_pats thing_inside
tcDataConPat :: PatEnv -> Located Name -> DataCon
-> ExpSigmaType -- Type of the pattern
-> HsConPatDetails GhcRn -> TcM a
-> TcM (Pat GhcTcId, a)
-> TcM (Pat GhcTc, a)
tcDataConPat penv (L con_span con_name) data_con pat_ty
arg_pats thing_inside
= do { let tycon = dataConTyCon data_con
......@@ -923,7 +923,7 @@ tcDataConPat penv (L con_span con_name) data_con pat_ty
tcPatSynPat :: PatEnv -> Located Name -> PatSyn
-> ExpSigmaType -- Type of the pattern
-> HsConPatDetails GhcRn -> TcM a
-> TcM (Pat GhcTcId, a)
-> TcM (Pat GhcTc, a)
tcPatSynPat penv (L con_span _) pat_syn pat_ty arg_pats thing_inside
= do { let (univ_tvs, req_theta, ex_tvs, prov_theta, arg_tys, ty) = patSynSig pat_syn
......@@ -1094,7 +1094,7 @@ tcConArgs con_like arg_tys penv con_args thing_inside = case con_args of
; return (RecCon (HsRecFields rpats' dd), res) }
where
tc_field :: Checker (LHsRecField GhcRn (LPat GhcRn))
(LHsRecField GhcTcId (LPat GhcTcId))
(LHsRecField GhcTc (LPat GhcTc))
tc_field penv
(L l (HsRecField (L loc (FieldOcc sel (L lr rdr))) pat pun))
thing_inside
......
......@@ -98,10 +98,10 @@ explains a very similar design when generalising over a type family instance
equation.
-}
tcRules :: [LRuleDecls GhcRn] -> TcM [LRuleDecls GhcTcId]
tcRules :: [LRuleDecls GhcRn] -> TcM [LRuleDecls GhcTc]
tcRules decls = mapM (wrapLocM tcRuleDecls) decls
tcRuleDecls :: RuleDecls GhcRn -> TcM (RuleDecls GhcTcId)
tcRuleDecls :: RuleDecls GhcRn -> TcM (RuleDecls GhcTc)
tcRuleDecls (HsRules { rds_src = src
, rds_rules = decls })
= do { tc_decls <- mapM (wrapLocM tcRule) decls
......@@ -109,7 +109,7 @@ tcRuleDecls (HsRules { rds_src = src
, rds_src = src
, rds_rules = tc_decls } }
tcRule :: RuleDecl GhcRn -> TcM (RuleDecl GhcTcId)
tcRule :: RuleDecl GhcRn -> TcM (RuleDecl GhcTc)
tcRule (HsRule { rd_ext = ext
, rd_name = rname@(L _ (_,name))
, rd_act = act
......
......@@ -150,10 +150,10 @@ import Data.Proxy ( Proxy (..) )
************************************************************************
-}
tcTypedBracket :: HsExpr GhcRn -> HsBracket GhcRn -> ExpRhoType -> TcM (HsExpr GhcTcId)
tcTypedBracket :: HsExpr GhcRn -> HsBracket GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc)
tcUntypedBracket :: HsExpr GhcRn -> HsBracket GhcRn -> [PendingRnSplice] -> ExpRhoType
-> TcM (HsExpr GhcTcId)
tcSpliceExpr :: HsSplice GhcRn -> ExpRhoType -> TcM (HsExpr GhcTcId)
-> TcM (HsExpr GhcTc)
tcSpliceExpr :: HsSplice GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc)
-- None of these functions add constraints to the LIE
-- runQuasiQuoteExpr :: HsQuasiQuote RdrName -> RnM (LHsExpr RdrName)
......
......@@ -9,7 +9,7 @@ import GHC.Hs.Expr ( PendingRnSplice, DelayedSplice )
import GHC.Tc.Types( TcM , SpliceType )
import GHC.Tc.Utils.TcType ( ExpRhoType )
import GHC.Types.Annotations ( Annotation, CoreAnnTarget )
import GHC.Hs.Extension ( GhcTcId, GhcRn, GhcPs, GhcTc )
import GHC.Hs.Extension ( GhcRn, GhcPs, GhcTc )
import GHC.Hs ( HsSplice, HsBracket, HsExpr, LHsExpr, LHsType, LPat,
LHsDecl, ThModFinalizers )
......@@ -17,28 +17,28 @@ import qualified Language.Haskell.TH as TH
tcSpliceExpr :: HsSplice GhcRn
-> ExpRhoType
-> TcM (HsExpr GhcTcId)
-> TcM (HsExpr GhcTc)
tcUntypedBracket :: HsExpr GhcRn
-> HsBracket GhcRn
-> [PendingRnSplice]
-> ExpRhoType
-> TcM (HsExpr GhcTcId)
-> TcM (HsExpr GhcTc)
tcTypedBracket :: HsExpr GhcRn
-> HsBracket GhcRn
-> ExpRhoType
-> TcM (HsExpr GhcTcId)
-> TcM (HsExpr GhcTc)
runTopSplice :: DelayedSplice -> TcM (HsExpr GhcTc)
runAnnotation :: CoreAnnTarget -> LHsExpr GhcRn -> TcM Annotation
tcTopSpliceExpr :: SpliceType -> TcM (LHsExpr GhcTcId) -> TcM (LHsExpr GhcTcId)
tcTopSpliceExpr :: SpliceType -> TcM (LHsExpr GhcTc) -> TcM (LHsExpr GhcTc)
runMetaE :: LHsExpr GhcTcId -> TcM (LHsExpr GhcPs)
runMetaP :: LHsExpr GhcTcId -> TcM (LPat GhcPs)
runMetaT :: LHsExpr GhcTcId -> TcM (LHsType GhcPs)
runMetaD :: LHsExpr GhcTcId -> TcM [LHsDecl GhcPs]
runMetaE :: LHsExpr GhcTc -> TcM (LHsExpr GhcPs)
runMetaP :: LHsExpr GhcTc -> TcM (LPat GhcPs)
runMetaT :: LHsExpr GhcTc -> TcM (LHsType GhcPs)
runMetaD :: LHsExpr GhcTc -> TcM [LHsDecl GhcPs]
lookupThName_maybe :: TH.Name -> TcM (Maybe Name)
runQuasi :: TH.Q a -> TcM a
......
......@@ -183,7 +183,7 @@ tcClassSigs clas sigs def_methods
-}
tcClassDecl2 :: LTyClDecl GhcRn -- The class declaration
-> TcM (LHsBinds GhcTcId)
-> TcM (LHsBinds GhcTc)
tcClassDecl2 (L _ (ClassDecl {tcdLName = class_name, tcdSigs = sigs,
tcdMeths = default_binds}))
......@@ -217,7 +217,7 @@ tcClassDecl2 d = pprPanic "tcClassDecl2" (ppr d)
tcDefMeth :: Class -> [TyVar] -> EvVar -> LHsBinds GhcRn
-> HsSigFun -> TcPragEnv -> ClassOpItem
-> TcM (LHsBinds GhcTcId)
-> TcM (LHsBinds GhcTc)
-- Generate code for default methods
-- This is incompatible with Hugs, which expects a polymorphic
-- default method for every class op, regardless of whether or not
......
......@@ -1764,7 +1764,7 @@ tcMethodBody clas tyvars dfun_ev_vars inst_tys
| otherwise = thing
tcMethodBodyHelp :: HsSigFun -> Id -> TcId
-> LHsBind GhcRn -> TcM (LHsBinds GhcTcId)
-> LHsBind GhcRn -> TcM (LHsBinds GhcTc)
tcMethodBodyHelp hs_sig_fn sel_id local_meth_id meth_bind
| Just hs_sig_ty <- hs_sig_fn sel_name
-- There is a signature in the instance
......
......@@ -426,7 +426,7 @@ tcCheckPatSynDecl psb@PSB{ psb_id = lname@(L _ name), psb_args = details
(args', arg_tys)
pat_ty rec_fields }
where
tc_arg :: TCvSubst -> Name -> Type -> TcM (LHsExpr GhcTcId)
tc_arg :: TCvSubst -> Name -> Type -> TcM (LHsExpr GhcTc)
tc_arg subst arg_name arg_ty
= do { -- Look up the variable actually bound by lpat
-- and check that it has the expected type
......@@ -596,8 +596,7 @@ tc_patsyn_finish :: Located Name -- ^ PatSyn Name
-> LPat GhcTc -- ^ Pattern of the PatSyn
-> ([TcInvisTVBinder], [PredType], TcEvBinds, [EvVar])
-> ([TcInvisTVBinder], [TcType], [PredType], [EvTerm])