Hoogle Search

Within LTS Haskell 24.40 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. splitForAllTyVars :: Type -> ([TyVar], Type)

    ghc GHC.Core.Type

    Like splitForAllTyCoVars, but split only for tyvars. This always succeeds, even if it returns only an empty list. Note that the result type returned may have free variables that were bound by a forall.

  2. tidyForAllTyBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis)

    ghc GHC.Core.Type

    No documentation available.

  3. tidyForAllTyBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])

    ghc GHC.Core.Type

    No documentation available.

  4. 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 get
    T (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.

  5. exprOkForSpecEval :: (Id -> Bool) -> CoreExpr -> Bool

    ghc 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.

  6. exprOkForSpeculation :: CoreExpr -> Bool

    ghc 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
    More specifically, this means that: * A: Evaluation of the expression reaches weak-head-normal-form, * B: soon, * C: without causing a write side effect (e.g. writing a mutable variable). In particular, an expression that may * throw a synchronous Haskell exception, or * risk an unchecked runtime exception (e.g. array out of bounds, divide by zero) is not considered OK-for-speculation, as these violate condition A. For exprOkToDiscard, condition A is weakened to allow expressions that might risk an unchecked runtime exception but must otherwise reach weak-head-normal-form. (Note that exprOkForSpeculation implies exprOkToDiscard) But in fact both functions are a bit more conservative than the above, in at least the following ways:
    • 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.
    As an example of the considerations in this test, consider:
    let x = case y# +# 1# of { r# -> I# r# }
    in E
    
    being 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.

  7. shouldStrictifyIdForCbv :: Var -> Bool

    ghc 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.

  8. shouldUseCbvForId :: Var -> Bool

    ghc GHC.Core.Utils

    No documentation available.

  9. toIfaceForAllBndr :: VarBndr TyCoVar flag -> VarBndr IfaceBndr flag

    ghc GHC.CoreToIface

    No documentation available.

  10. toIfaceForAllBndrs :: [VarBndr TyCoVar vis] -> [VarBndr IfaceBndr vis]

    ghc GHC.CoreToIface

    No documentation available.

Page 449 of many | Previous | Next