ghc-lib-0.20190204: The GHC API, decoupled from GHC versions

Safe HaskellNone
LanguageHaskell2010

Demand

Synopsis

Documentation

data StrDmd Source #

Vanilla strictness domain

Instances
Instance details

Defined in Demand

Methods

(==) :: StrDmd -> StrDmd -> Bool #

(/=) :: StrDmd -> StrDmd -> Bool #

Instance details

Defined in Demand

Methods

showsPrec :: Int -> StrDmd -> ShowS #

show :: StrDmd -> String #

showList :: [StrDmd] -> ShowS #

Instance details

Defined in Demand

Instance details

Defined in Demand

data UseDmd Source #

Domain for genuine usage

Constructors

UCall Count UseDmd

Call demand for absence. Used only for values of function type

UProd [ArgUse]

Product. Used only for values of product type See Note [Don't optimise UProd(Used) to Used]

Invariant: Not all components are Abs (in that case, use UHead)

UHead

May be used but its sub-components are definitely *not* used. For product types, UHead is equivalent to U(AAA); see mkUProd.

UHead is needed only to express the demand of seq and 'case' which are polymorphic; i.e. the scrutinised value is of type a rather than a product type. That's why we can't use UProd [A,A,A]

Since (UCall _ Abs) is ill-typed, UHead doesn't make sense for lambdas

Used

May be used and its sub-components may be used. (top of the lattice)

Instances
Instance details

Defined in Demand

Methods

(==) :: UseDmd -> UseDmd -> Bool #

(/=) :: UseDmd -> UseDmd -> Bool #

Instance details

Defined in Demand

Methods

showsPrec :: Int -> UseDmd -> ShowS #

show :: UseDmd -> String #

showList :: [UseDmd] -> ShowS #

Instance details

Defined in Demand

Instance details

Defined in Demand

data Count Source #

Abstract counting of usages

Instances
Instance details

Defined in Demand

Methods

(==) :: Count -> Count -> Bool #

(/=) :: Count -> Count -> Bool #

Instance details

Defined in Demand

Methods

showsPrec :: Int -> Count -> ShowS #

show :: Count -> String #

showList :: [Count] -> ShowS #

Instance details

Defined in Demand

Instance details

Defined in Demand

type Demand = JointDmd ArgStr ArgUse Source #

type DmdShell = JointDmd (Str ()) (Use ()) Source #

type CleanDemand = JointDmd StrDmd UseDmd Source #

getStrDmd :: JointDmd s u -> s Source #

getUseDmd :: JointDmd s u -> u Source #

mkProdDmd :: [Demand] -> CleanDemand Source #

mkOnceUsedDmd :: CleanDemand -> Demand Source #

mkManyUsedDmd :: CleanDemand -> Demand Source #

mkHeadStrict :: CleanDemand -> CleanDemand Source #

oneifyDmd :: JointDmd s (Use u) -> JointDmd s (Use u) Source #

toCleanDmd :: Demand -> (DmdShell, CleanDemand) Source #

absDmd :: Demand Source #

topDmd :: Demand Source #

botDmd :: Demand Source #

seqDmd :: Demand Source #

lubDmd :: Demand -> Demand -> Demand Source #

bothDmd :: Demand -> Demand -> Demand Source #

lazyApply1Dmd :: Demand Source #

lazyApply2Dmd :: Demand Source #

strictApply1Dmd :: Demand Source #

catchArgDmd :: Demand Source #

isTopDmd :: Demand -> Bool Source #

isAbsDmd :: JointDmd (Str s) (Use u) -> Bool Source #

isSeqDmd :: Demand -> Bool Source #

peelUseCall :: UseDmd -> Maybe (Count, UseDmd) Source #

cleanUseDmd_maybe :: Demand -> Maybe UseDmd Source #

strictenDmd :: Demand -> CleanDemand Source #

bothCleanDmd :: CleanDemand -> CleanDemand -> CleanDemand Source #

addCaseBndrDmd :: Demand -> [Demand] -> [Demand] Source #

data DmdType Source #

Constructors

Instances
Instance details

Defined in Demand

Methods

(==) :: DmdType -> DmdType -> Bool #

(/=) :: DmdType -> DmdType -> Bool #

Instance details

Defined in Demand

Instance details

Defined in Demand

dmdTypeDepth :: DmdType -> Arity Source #

lubDmdType :: DmdType -> DmdType -> DmdType Source #

bothDmdType :: DmdType -> BothDmdArg -> DmdType Source #

nopDmdType :: DmdType Source #

botDmdType :: DmdType Source #

mkDmdType :: DmdEnv -> [Demand] -> DmdResult -> DmdType Source #

addDemand :: Demand -> DmdType -> DmdType Source #

removeDmdTyArgs :: DmdType -> DmdType Source #

type BothDmdArg = (DmdEnv, Termination ()) Source #

mkBothDmdArg :: DmdEnv -> BothDmdArg Source #

toBothDmdArg :: DmdType -> BothDmdArg Source #

type DmdEnv = VarEnv Demand Source #

emptyDmdEnv :: VarEnv Demand Source #

peelFV :: DmdType -> Var -> (DmdType, Demand) Source #

findIdDemand :: DmdType -> Var -> Demand Source #

type DmdResult = Termination CPRResult Source #

data CPRResult Source #

Instances
Instance details

Defined in Demand

Instance details

Defined in Demand

Instance details

Defined in Demand

Instance details

Defined in Demand

Instance details

Defined in Demand

isBotRes :: DmdResult -> Bool Source #

isTopRes :: DmdResult -> Bool Source #

topRes :: DmdResult Source #

botRes :: DmdResult Source #

exnRes :: DmdResult Source #

cprProdRes :: [DmdType] -> DmdResult Source #

vanillaCprProdRes :: Arity -> DmdResult Source #

cprSumRes :: ConTag -> DmdResult Source #

appIsBottom :: StrictSig -> Int -> Bool Source #

isBottomingSig :: StrictSig -> Bool Source #

pprIfaceStrictSig :: StrictSig -> SDoc Source #

trimCPRInfo :: Bool -> Bool -> DmdResult -> DmdResult Source #

returnsCPR_maybe :: DmdResult -> Maybe ConTag Source #

newtype StrictSig Source #

Constructors

Instances
Instance details

Defined in Demand

Instance details

Defined in Demand

Instance details

Defined in Demand

mkStrictSig :: DmdType -> StrictSig Source #

mkClosedStrictSig :: [Demand] -> DmdResult -> StrictSig Source #

nopSig :: StrictSig Source #

botSig :: StrictSig Source #

exnSig :: StrictSig Source #

cprProdSig :: Arity -> StrictSig Source #

isTopSig :: StrictSig -> Bool Source #

hasDemandEnvSig :: StrictSig -> Bool Source #

splitStrictSig :: StrictSig -> ([Demand], DmdResult) Source #

strictSigDmdEnv :: StrictSig -> DmdEnv Source #

increaseStrictSigArity :: Int -> StrictSig -> StrictSig Source #

etaExpandStrictSig :: Arity -> StrictSig -> StrictSig Source #

seqDemand :: Demand -> () Source #

seqDemandList :: [Demand] -> () Source #

seqDmdType :: DmdType -> () Source #

seqStrictSig :: StrictSig -> () Source #

evalDmd :: Demand Source #

cleanEvalDmd :: CleanDemand Source #

cleanEvalProdDmd :: Arity -> CleanDemand Source #

isStrictDmd :: JointDmd (Str s) (Use u) -> Bool Source #

splitDmdTy :: DmdType -> (Demand, DmdType) Source #

splitFVs :: Bool -> DmdEnv -> (DmdEnv, DmdEnv) Source #

deferAfterIO :: DmdType -> DmdType Source #

postProcessUnsat :: DmdShell -> DmdType -> DmdType Source #

postProcessDmdType :: DmdShell -> DmdType -> BothDmdArg Source #

splitProdDmd_maybe :: Demand -> Maybe [Demand] Source #

peelCallDmd :: CleanDemand -> (CleanDemand, DmdShell) Source #

peelManyCalls :: Int -> CleanDemand -> DmdShell Source #

mkCallDmd :: CleanDemand -> CleanDemand Source #

mkWorkerDemand :: Int -> Demand Source #

dmdTransformSig :: StrictSig -> CleanDemand -> DmdType Source #

dmdTransformDataConSig :: Arity -> StrictSig -> CleanDemand -> DmdType Source #

dmdTransformDictSelSig :: StrictSig -> CleanDemand -> DmdType Source #

argOneShots :: Demand -> [OneShotInfo] Source #

argsOneShots :: StrictSig -> Arity -> [[OneShotInfo]] Source #

saturatedByOneShots :: Int -> Demand -> Bool Source #

trimToType :: Demand -> TypeShape -> Demand Source #

data TypeShape Source #

Constructors

Instances
Instance details

Defined in Demand

useCount :: Use u -> Count Source #

isUsedOnce :: JointDmd (Str s) (Use u) -> Bool Source #

reuseEnv :: DmdEnv -> DmdEnv Source #

killUsageDemand :: DynFlags -> Demand -> Demand Source #

killUsageSig :: DynFlags -> StrictSig -> StrictSig Source #

zapUsageDemand :: Demand -> Demand Source #

zapUsageEnvSig :: StrictSig -> StrictSig Source #

zapUsedOnceDemand :: Demand -> Demand Source #

Remove all 1* information (but not C1 information) from the demand

zapUsedOnceSig :: StrictSig -> StrictSig Source #

Remove all 1* information (but not C1 information) from the strictness signature

strictifyDictDmd :: Type -> Demand -> Demand Source #

strictifyDmd :: Demand -> Demand Source #

AltStyle によって変換されたページ (->オリジナル) /