GHC.HsToCore.Expr

ghc-9.2.0.20210422: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.HsToCore.Expr

Synopsis

- dsExpr :: HsExpr GhcTc -> DsM CoreExpr
- dsLExpr :: LHsExpr GhcTc -> DsM CoreExpr
- dsLExprNoLP :: LHsExpr GhcTc -> DsM CoreExpr
- dsLocalBinds :: HsLocalBinds GhcTc -> CoreExpr -> DsM CoreExpr
- dsValBinds :: HsValBinds GhcTc -> CoreExpr -> DsM CoreExpr
- dsLit :: HsLit GhcRn -> DsM CoreExpr
- dsSyntaxExpr :: SyntaxExpr GhcTc -> [CoreExpr] -> DsM CoreExpr

# Documentation

dsExpr :: HsExpr GhcTc -> DsM CoreExpr Source #

dsLExpr :: LHsExpr GhcTc -> DsM CoreExpr Source #

Replace the body of the function with this block to test the hsExprType function in GHC.Tc.Utils.Zonk: putSrcSpanDs loc $ do { core_expr <- dsExpr e ; if debugIsOn && not ( exprType core_expr `eqType` hsExprType e -- ) then (assertPprPanic "compiler.GHCHsToCoreExpr.hs" 249 ( ppr e + dcolon + ppr (hsExprType e) $$ -- ppr core_expr + dcolon + ppr (exprType core_expr) )) else return ()

dsLExprNoLP :: LHsExpr GhcTc -> DsM CoreExpr Source #

Variant of `dsLExpr` that ensures that the result is not levity polymorphic. This should be used when the resulting expression will be an argument to some other function. See Note [Levity polymorphism checking] in GHC.HsToCore.Monad See Note [Levity polymorphism invariants] in GHC.Core

dsLocalBinds :: HsLocalBinds GhcTc -> CoreExpr -> DsM CoreExpr Source #

dsValBinds :: HsValBinds GhcTc -> CoreExpr -> DsM CoreExpr Source #

dsLit :: HsLit GhcRn -> DsM CoreExpr Source #

dsSyntaxExpr :: SyntaxExpr GhcTc -> [CoreExpr] -> DsM CoreExpr Source #