Hoogle Search
Within LTS Haskell 24.51 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
tidyForAllTyBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])ghc GHC.Core.Type No documentation available.
tyConForAllTyFlags :: TyCon -> [Type] -> [ForAllTyFlag]ghc GHC.Core.Type Given a TyCon and a list of argument types to which the TyCon is applied, determine each argument's visibility (Inferred, Specified, or Required). Wrinkle: consider the following scenario:
T :: forall k. k -> k tyConForAllTyFlags T [forall m. m -> m -> m, S, R, Q]
After substituting, we getT (forall m. m -> m -> m) :: (forall m. m -> m -> m) -> forall n. n -> n -> n
Thus, the first argument is invisible, S is visible, R is invisible again, and Q is visible.exprOkForSpecEval :: (Id -> Bool) -> CoreExpr -> Boolghc GHC.Core.Utils A special version of exprOkForSpeculation used during Note [Speculative evaluation]. When the predicate arg fun_ok returns False for b, then b is never considered ok-for-spec.
exprOkForSpeculation :: CoreExpr -> Boolghc GHC.Core.Utils To a first approximation, exprOkForSpeculation returns True of an expression that is:
- Safe to evaluate even if normal order eval might not evaluate the expression at all, and
- Safe not to evaluate even if normal order would do so
- W1: We do not take advantage of already-evaluated lifted variables. As a result, exprIsHNF DOES NOT imply exprOkForSpeculation; if y is a case-binder of lifted type, then exprIsHNF y is True, while exprOkForSpeculation y is False. See Note [exprOkForSpeculation and evaluated variables] for why.
- W2: Read-effects on mutable variables are currently also included. See Note [Classifying primop effects] GHC.Builtin.PrimOps.
- W3: Currently, exprOkForSpeculation always returns False for let-expressions. Lets can be stacked deeply, so we just give up. In any case, the argument of exprOkForSpeculation is usually in a strict context, so any lets will have been floated away.
let x = case y# +# 1# of { r# -> I# r# } in Ebeing translated to:case y# +# 1# of { r# -> let x = I# r# in E }We can only do this if the y# +# 1# is ok for speculation: it has no side effects, and can't diverge or raise an exception. See also Note [Classifying primop effects] in GHC.Builtin.PrimOps and Note [Transformations affected by primop effects]. exprOkForSpeculation is used to define Core's let-can-float invariant. (See Note [Core let-can-float invariant] in GHC.Core.) It is therefore frequently called on arguments of unlifted type, especially via needsCaseBinding. But it is sometimes called on expressions of lifted type as well. For example, see Note [Speculative evaluation] in GHC.CoreToStg.Prep.shouldStrictifyIdForCbv :: Var -> Boolghc GHC.Core.Utils Do we expect there to be any benefit if we make this var strict in order for it to get treated as as cbv argument? See Note [Which Ids should be strictified] See Note [CBV Function Ids] for more background.
shouldUseCbvForId :: Var -> Boolghc GHC.Core.Utils No documentation available.
toIfaceForAllBndr :: VarBndr TyCoVar flag -> VarBndr IfaceBndr flagghc GHC.CoreToIface No documentation available.
toIfaceForAllBndrs :: [VarBndr TyCoVar vis] -> [VarBndr IfaceBndr vis]ghc GHC.CoreToIface No documentation available.
coreToStg_platform :: CoreToStgOpts -> Platformghc GHC.CoreToStg No documentation available.
cp_platform :: CorePrepConfig -> Platformghc GHC.CoreToStg.Prep No documentation available.