Demand

ghc-8.0.0.20160204: The GHC API

Safe Haskell | None
Language | Haskell2010

Demand

# Documentation

data StrDmd Source

Instances

Eq StrDmd |
Methods (==) :: StrDmd -> StrDmd -> Bool (/=) :: StrDmd -> StrDmd -> Bool
Show StrDmd |
Methods showsPrec :: Int -> StrDmd -> ShowS Source show :: StrDmd -> String Source showList :: [StrDmd] -> ShowS Source
Outputable StrDmd |
Methods ppr :: StrDmd -> SDoc Source pprPrec :: Rational -> StrDmd -> SDoc Source
Binary StrDmd |
Methods put_ :: BinHandle -> StrDmd -> IO () Source put :: BinHandle -> StrDmd -> IO (Bin StrDmd) Source get :: BinHandle -> IO StrDmd Source

data UseDmd Source

Constructors

UCall Count UseDmd |
UProd [ArgUse] |
UHead |
Used |

Instances

Eq UseDmd |
Methods (==) :: UseDmd -> UseDmd -> Bool (/=) :: UseDmd -> UseDmd -> Bool
Show UseDmd |
Methods showsPrec :: Int -> UseDmd -> ShowS Source show :: UseDmd -> String Source showList :: [UseDmd] -> ShowS Source
Outputable UseDmd |
Methods ppr :: UseDmd -> SDoc Source pprPrec :: Rational -> UseDmd -> SDoc Source
Binary UseDmd |
Methods put_ :: BinHandle -> UseDmd -> IO () Source put :: BinHandle -> UseDmd -> IO (Bin UseDmd) Source get :: BinHandle -> IO UseDmd Source

data Count Source

Constructors

One |
Many |

Instances

Eq Count |
Methods (==) :: Count -> Count -> Bool (/=) :: Count -> Count -> Bool
Show Count |
Methods showsPrec :: Int -> Count -> ShowS Source show :: Count -> String Source showList :: [Count] -> ShowS Source
Outputable Count |
Methods ppr :: Count -> SDoc Source pprPrec :: Rational -> Count -> SDoc Source
Binary Count |
Methods put_ :: BinHandle -> Count -> IO () Source put :: BinHandle -> Count -> IO (Bin Count) Source get :: BinHandle -> IO Count Source

countOnce :: Count Source

countMany :: Count Source

type Demand = JointDmd ArgStr ArgUse 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 :: Demand -> Demand Source

toCleanDmd :: Demand -> Type -> (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 :: Demand -> 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

DmdType DmdEnv [Demand] DmdResult |

Instances

Eq DmdType |
Methods (==) :: DmdType -> DmdType -> Bool (/=) :: DmdType -> DmdType -> Bool
Outputable DmdType |
Methods ppr :: DmdType -> SDoc Source pprPrec :: Rational -> DmdType -> SDoc Source
Binary DmdType |
Methods put_ :: BinHandle -> DmdType -> IO () Source put :: BinHandle -> DmdType -> IO (Bin DmdType) Source get :: BinHandle -> IO DmdType Source

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

Eq CPRResult |
Methods (==) :: CPRResult -> CPRResult -> Bool (/=) :: CPRResult -> CPRResult -> Bool
Show CPRResult |
Methods showsPrec :: Int -> CPRResult -> ShowS Source show :: CPRResult -> String Source showList :: [CPRResult] -> ShowS Source
Outputable CPRResult |
Methods ppr :: CPRResult -> SDoc Source pprPrec :: Rational -> CPRResult -> SDoc Source
Binary CPRResult |
Methods put_ :: BinHandle -> CPRResult -> IO () Source put :: BinHandle -> CPRResult -> IO (Bin CPRResult) Source get :: BinHandle -> IO CPRResult Source
Binary DmdResult |
Methods put_ :: BinHandle -> DmdResult -> IO () Source put :: BinHandle -> DmdResult -> IO (Bin DmdResult) Source get :: BinHandle -> IO DmdResult Source

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

StrictSig DmdType |

Instances

Eq StrictSig |
Methods (==) :: StrictSig -> StrictSig -> Bool (/=) :: StrictSig -> StrictSig -> Bool
Outputable StrictSig |
Methods ppr :: StrictSig -> SDoc Source pprPrec :: Rational -> StrictSig -> SDoc Source
Binary StrictSig |
Methods put_ :: BinHandle -> StrictSig -> IO () Source put :: BinHandle -> StrictSig -> IO (Bin StrictSig) Source get :: BinHandle -> IO StrictSig Source

mkStrictSig :: DmdType -> StrictSig Source

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

nopSig :: StrictSig Source

botSig :: StrictSig Source

cprProdSig :: Arity -> StrictSig Source

isNopSig :: StrictSig -> Bool Source

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

increaseStrictSigArity :: Int -> 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 :: Demand -> 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

mkCallDmd :: CleanDemand -> CleanDemand Source

dmdTransformSig :: StrictSig -> CleanDemand -> DmdType Source

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

dmdTransformDictSelSig :: StrictSig -> CleanDemand -> DmdType Source

argOneShots :: OneShotInfo -> Demand -> [OneShotInfo] Source

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

trimToType :: Demand -> TypeShape -> Demand Source

data TypeShape Source

Constructors

TsFun TypeShape |
TsProd [TypeShape] |
TsUnk |

Instances

Outputable TypeShape |
Methods ppr :: TypeShape -> SDoc Source pprPrec :: Rational -> TypeShape -> SDoc Source

useCount :: Use u -> Count Source

isUsedOnce :: Demand -> Bool Source

reuseEnv :: DmdEnv -> DmdEnv Source

killUsageDemand :: DynFlags -> Demand -> Demand Source

killUsageSig :: DynFlags -> StrictSig -> StrictSig Source

zapUsageDemand :: Demand -> Demand Source

strictifyDictDmd :: Type -> Demand -> Demand Source