-- | Translate a HsExpr to a Core expression. This does renaming, type
-- checking, simplification of class instances and desugaring. The result is
-- a let expression that holds the given expression and a number of binds that
-- | Translate a HsExpr to a Core expression. This does renaming, type
-- checking, simplification of class instances and desugaring. The result is
-- a let expression that holds the given expression and a number of binds that
tc_expr
-- Desugar the expression, resulting in core.
let rdr_env = HscTypes.ic_rn_gbl_env icontext
tc_expr
-- Desugar the expression, resulting in core.
let rdr_env = HscTypes.ic_rn_gbl_env icontext
-- | Create an Id from a RdrName. Might not work for DataCons...
mkId :: RdrName.RdrName -> GHC.Ghc Id.Id
mkId rdr_name = do
env <- GHC.getSession
-- | Create an Id from a RdrName. Might not work for DataCons...
mkId :: RdrName.RdrName -> GHC.Ghc Id.Id
mkId rdr_name = do
env <- GHC.getSession
-- Translage the TcRn (typecheck-rename) monad in an IO monad
TcRnMonad.initTcPrintErrors env PrelNames.iNTERACTIVE $
-- Automatically import all available modules, so fully qualified names
-- Translage the TcRn (typecheck-rename) monad in an IO monad
TcRnMonad.initTcPrintErrors env PrelNames.iNTERACTIVE $
-- Automatically import all available modules, so fully qualified names
occ_name = Name.nameOccName tycon_name
tycon_rdrname = RdrName.mkRdrQual mod_name occ_name
tycon_ty = SrcLoc.noLoc $ HsTypes.HsTyVar tycon_rdrname
occ_name = Name.nameOccName tycon_name
tycon_rdrname = RdrName.mkRdrQual mod_name occ_name
tycon_ty = SrcLoc.noLoc $ HsTypes.HsTyVar tycon_rdrname
-- | Evaluate a CoreExpr and return its value. For this to work, the caller
-- should already know the result type for sure, since the result value is
-- | Evaluate a CoreExpr and return its value. For this to work, the caller
-- should already know the result type for sure, since the result value is