Commit 0d61f866 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 4acc2934
......@@ -95,7 +95,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)
......
......@@ -2479,7 +2479,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)
......
......@@ -85,7 +85,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 $
......@@ -123,7 +123,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 $
......@@ -132,14 +132,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') }
......@@ -316,7 +316,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
......@@ -339,7 +339,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 (unrestricted scrut_ty) matches (mkCheckExpType res_ty)
where
......@@ -423,7 +423,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) }
......
......@@ -323,7 +323,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
......@@ -384,7 +384,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
......@@ -420,7 +420,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
......@@ -461,7 +461,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
......@@ -499,7 +499,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
-- recursive bindings must be unrestricted
-- (the ids added to the environment here are the name of the recursive definitions).
......@@ -532,7 +532,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
......@@ -585,7 +585,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
......@@ -629,7 +629,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
......@@ -662,7 +662,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
......@@ -689,7 +689,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,
......@@ -803,7 +803,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 $
......@@ -1272,7 +1272,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 })]
......@@ -1345,7 +1345,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
......@@ -1445,7 +1445,7 @@ newSigLetBndr no_gen name (TISI { sig_inst_tau = tau })
-- declarations. Which are all unrestricted currently.
-------------------
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] $
......
......@@ -116,7 +116,7 @@ tcCheckPolyExprNC expr res_ty = tcPolyExprNC expr (mkCheckExpType res_ty)
-- These versions take an ExpType
tcPolyExpr, tcPolyExprNC
:: LHsExpr GhcRn -> ExpSigmaType
-> TcM (LHsExpr GhcTcId)
-> TcM (LHsExpr GhcTc)
tcPolyExpr expr res_ty
= addExprCtxt expr $
......@@ -146,7 +146,7 @@ tcCheckMonoExpr, tcCheckMonoExprNC
:: LHsExpr GhcRn -- Expression to type check
-> TcRhoType -- Expected type
-- Definitely no foralls at the top
-> TcM (LHsExpr GhcTcId)
-> TcM (LHsExpr GhcTc)
tcCheckMonoExpr expr res_ty = tcMonoExpr expr (mkCheckExpType res_ty)
tcCheckMonoExprNC expr res_ty = tcMonoExprNC expr (mkCheckExpType res_ty)
......@@ -154,7 +154,7 @@ tcMonoExpr, tcMonoExprNC
:: LHsExpr GhcRn -- Expression to type check
-> ExpRhoType -- Expected type
-- Definitely no foralls at the top
-> TcM (LHsExpr GhcTcId)
-> TcM (LHsExpr GhcTc)
tcMonoExpr expr res_ty
= addExprCtxt expr $
......
......@@ -5,28 +5,28 @@ import GHC.Tc.Utils.TcType ( TcRhoType, TcSigmaType, SyntaxOpType, ExpType, ExpR
import GHC.Tc.Types ( TcM )
import GHC.Tc.Types.Origin ( CtOrigin )
import GHC.Core.Type ( Mult )
import GHC.Hs.Extension ( GhcRn, GhcTcId )
import GHC.Hs.Extension ( GhcRn, GhcTc )
tcCheckPolyExpr ::
LHsExpr GhcRn
-> TcSigmaType
-> TcM (LHsExpr GhcTcId)
-> TcM (LHsExpr GhcTc)
tcMonoExpr, tcMonoExprNC ::
LHsExpr GhcRn
-> ExpRhoType
-> TcM (LHsExpr GhcTcId)
-> TcM (LHsExpr GhcTc)
tcCheckMonoExpr, tcCheckMonoExprNC ::
LHsExpr GhcRn
-> TcRhoType
-> TcM (LHsExpr GhcTcId)
-> TcM (LHsExpr GhcTc)
tcExpr :: HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTcId)
tcExpr :: HsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc)
tcInferSigma :: LHsExpr GhcRn -> TcM (LHsExpr GhcTcId, TcSigmaType)
tcInferSigma :: LHsExpr GhcRn -> TcM (LHsExpr GhcTc, TcSigmaType)
tcInferRho, tcInferRhoNC ::
LHsExpr GhcRn -> TcM (LHsExpr GhcTcId, TcRhoType)
LHsExpr GhcRn -> TcM (LHsExpr GhcTc, TcRhoType)
tcSyntaxOp :: CtOrigin
-> SyntaxExprRn
......@@ -43,4 +43,4 @@ tcSyntaxOpGen :: CtOrigin
-> TcM (a, SyntaxExprTc)
tcCheckId :: Name -> ExpRhoType -> TcM (HsExpr GhcTcId)
tcCheckId :: Name -> ExpRhoType -> TcM (HsExpr GhcTc)
......@@ -348,12 +348,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
......
......@@ -87,7 +87,7 @@ same number of arguments before using @tcMatches@ to do the work.
tcMatchesFun :: Located Name
-> MatchGroup GhcRn (LHsExpr GhcRn)
-> ExpRhoType -- 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
......@@ -131,13 +131,13 @@ parser guarantees that each equation has exactly one argument.
-}
tcMatchesCase :: (Outputable (body GhcRn)) =>
TcMatchCtxt body -- Case context
-> Scaled TcSigmaType -- Type of scrutinee
-> MatchGroup GhcRn (Located (body GhcRn)) -- The case alternatives
-> ExpRhoType -- Type of whole case expressions
-> TcM (MatchGroup GhcTcId (Located (body GhcTcId)))
-- Translated alternatives
-- wrapper goes from MatchGroup's ty to expected ty
TcMatchCtxt body -- Case context
-> Scaled TcSigmaType -- Type of scrutinee
-> MatchGroup GhcRn (Located (body GhcRn)) -- The case alternatives
-> ExpRhoType -- Type of whole case expressions
-> TcM (MatchGroup GhcTc (Located (body GhcTc)))
-- Translated alternatives
-- wrapper goes from MatchGroup's ty to expected ty
tcMatchesCase ctxt (Scaled scrut_mult scrut_ty) matches res_ty
= tcMatches ctxt [Scaled scrut_mult (mkCheckExpType scrut_ty)] res_ty matches
......@@ -146,7 +146,7 @@ tcMatchLambda :: SDoc -- see Note [Herald for matchExpectedFunTys] in GHC.Tc.Uti
-> TcMatchCtxt HsExpr
-> MatchGroup GhcRn (LHsExpr GhcRn)
-> ExpRhoType
-> TcM (HsWrapper, MatchGroup GhcTcId (LHsExpr GhcTcId))
-> TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
tcMatchLambda herald match_ctxt match res_ty
= matchExpectedFunTys herald GenSigCtxt n_pats res_ty $ \ pat_tys rhs_ty ->
tcMatches match_ctxt pat_tys rhs_ty match
......@@ -157,7 +157,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
......@@ -218,14 +218,14 @@ tcMatches :: (Outputable (body GhcRn)) => TcMatchCtxt body
-> [Scaled 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 })
= do { (Scaled _ rhs_ty):pat_tys <- tauifyMultipleMatches matches ((Scaled One rhs_ty):pat_tys) -- return type has implicitly multiplicity 1, it doesn't matter all that much in this case since it isn't used and is eliminated immediately.
......@@ -245,7 +245,7 @@ tcMatch :: (Outputable (body GhcRn)) => TcMatchCtxt body
-> [Scaled 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
......@@ -268,7 +268,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
......@@ -286,7 +286,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')
......@@ -307,7 +307,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
......@@ -333,7 +333,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)
; tcMonoExpr body res_ty
......@@ -355,13 +355,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 ())
......@@ -372,7 +372,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
......@@ -473,7 +473,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
......@@ -798,7 +798,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
......@@ -951,10 +951,10 @@ tcDoStmt _ stmt _ _
-- "GHC.Tc.Errors".
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
......@@ -1001,7 +1001,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
......@@ -1040,7 +1040,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
......@@ -1074,7 +1074,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))
......@@ -80,7 +80,7 @@ tcLetPat :: (Name -> Maybe TcId)
-> LetBndrSpec
-> LPat GhcRn -> Scaled 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
......@@ -97,7 +97,7 @@ tcPats :: HsMatchContext GhcRn
-> [LPat GhcRn] -- Patterns,
-> [Scaled 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,
......@@ -117,7 +117,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 (unrestricted exp_ty) penv pat thing_inside
......@@ -127,7 +127,7 @@ tcInferPat ctxt pat thing_inside
tcCheckPat :: HsMatchContext GhcRn
-> LPat GhcRn -> Scaled 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
......@@ -135,7 +135,7 @@ tcCheckPat_O :: HsMatchContext GhcRn
-> CtOrigin -- ^ origin to use if the type needs inst'ing
-> LPat GhcRn -> Scaled TcSigmaType
-> TcM a -- Checker for body
-> TcM (LPat GhcTcId, a)
-> TcM (LPat GhcTc, a)
tcCheckPat_O ctxt orig pat (Scaled pat_mult pat_ty) thing_inside
= tc_lpat (Scaled pat_mult (mkCheckExpType pat_ty)) penv pat thing_inside
where
......@@ -326,7 +326,7 @@ tcMultiple tc_pat penv args thing_inside
--------------------
tc_lpat :: Scaled 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)
......@@ -334,7 +334,7 @@ tc_lpat pat_ty penv (L span pat) thing_inside
; return (L span pat', res) }
tc_lpats :: [Scaled 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)
......@@ -348,7 +348,7 @@ checkManyPattern pat_ty = tcSubMult NonLinearPatternOrigin Many (scaledMult pat_
tc_pat :: Scaled 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
......@@ -849,7 +849,7 @@ to express the local scope of GADT refinements.
tcConPat :: PatEnv -> Located Name
-> Scaled 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
......@@ -862,7 +862,7 @@ tcConPat penv con_lname@(L _ con_name) pat_ty arg_pats thing_inside
tcDataConPat :: PatEnv -> Located Name -> DataCon
-> Scaled 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_scaled
arg_pats thing_inside
= do { let tycon = dataConTyCon data_con
......@@ -967,7 +967,7 @@ tcDataConPat penv (L con_span con_name) data_con pat_ty_scaled
tcPatSynPat :: PatEnv -> Located Name -> PatSyn
-> Scaled 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
......@@ -1143,7 +1143,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
......
......@@ -151,10 +151,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)