Demand

ghc-8.0.1: The GHC API

Safe Haskell | None
Language | Haskell2010

Demand

# Documentation

data StrDmd #

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 # pprPrec :: Rational -> StrDmd -> SDoc #
Binary StrDmd # |
Methods put_ :: BinHandle -> StrDmd -> IO () # put :: BinHandle -> StrDmd -> IO (Bin StrDmd) # get :: BinHandle -> IO StrDmd #

data UseDmd #

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 # pprPrec :: Rational -> UseDmd -> SDoc #
Binary UseDmd # |
Methods put_ :: BinHandle -> UseDmd -> IO () # put :: BinHandle -> UseDmd -> IO (Bin UseDmd) # get :: BinHandle -> IO UseDmd #

data Count #

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 # pprPrec :: Rational -> Count -> SDoc #
Binary Count # |
Methods put_ :: BinHandle -> Count -> IO () # put :: BinHandle -> Count -> IO (Bin Count) # get :: BinHandle -> IO Count #

countOnce :: Count #

countMany :: Count #

type Demand = JointDmd ArgStr ArgUse #

type CleanDemand = JointDmd StrDmd UseDmd #

getStrDmd :: JointDmd s u -> s #

getUseDmd :: JointDmd s u -> u #

mkProdDmd :: [Demand] -> CleanDemand #

mkOnceUsedDmd :: CleanDemand -> Demand #

mkManyUsedDmd :: CleanDemand -> Demand #

mkHeadStrict :: CleanDemand -> CleanDemand #

oneifyDmd :: Demand -> Demand #

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

absDmd :: Demand #

topDmd :: Demand #

botDmd :: Demand #

seqDmd :: Demand #

lubDmd :: Demand -> Demand -> Demand #

bothDmd :: Demand -> Demand -> Demand #

lazyApply1Dmd :: Demand #

lazyApply2Dmd :: Demand #

strictApply1Dmd :: Demand #

catchArgDmd :: Demand #

isTopDmd :: Demand -> Bool #

isAbsDmd :: Demand -> Bool #

isSeqDmd :: Demand -> Bool #

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

cleanUseDmd_maybe :: Demand -> Maybe UseDmd #

strictenDmd :: Demand -> CleanDemand #

bothCleanDmd :: CleanDemand -> CleanDemand -> CleanDemand #

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

data DmdType #

Constructors

DmdType DmdEnv [Demand] DmdResult |

Instances

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

dmdTypeDepth :: DmdType -> Arity #

lubDmdType :: DmdType -> DmdType -> DmdType #

bothDmdType :: DmdType -> BothDmdArg -> DmdType #

nopDmdType :: DmdType #

botDmdType :: DmdType #

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

addDemand :: Demand -> DmdType -> DmdType #

removeDmdTyArgs :: DmdType -> DmdType #

type BothDmdArg = (DmdEnv, Termination ()) #

mkBothDmdArg :: DmdEnv -> BothDmdArg #

toBothDmdArg :: DmdType -> BothDmdArg #

type DmdEnv = VarEnv Demand #

emptyDmdEnv :: VarEnv Demand #

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

findIdDemand :: DmdType -> Var -> Demand #

type DmdResult = Termination CPRResult #

data CPRResult #

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 # pprPrec :: Rational -> CPRResult -> SDoc #
Binary CPRResult # |
Methods put_ :: BinHandle -> CPRResult -> IO () # put :: BinHandle -> CPRResult -> IO (Bin CPRResult) # get :: BinHandle -> IO CPRResult #
Binary DmdResult # |
Methods put_ :: BinHandle -> DmdResult -> IO () # put :: BinHandle -> DmdResult -> IO (Bin DmdResult) # get :: BinHandle -> IO DmdResult #

isBotRes :: DmdResult -> Bool #

isTopRes :: DmdResult -> Bool #

topRes :: DmdResult #

botRes :: DmdResult #

exnRes :: DmdResult #

cprProdRes :: [DmdType] -> DmdResult #

vanillaCprProdRes :: Arity -> DmdResult #

cprSumRes :: ConTag -> DmdResult #

appIsBottom :: StrictSig -> Int -> Bool #

isBottomingSig :: StrictSig -> Bool #

pprIfaceStrictSig :: StrictSig -> SDoc #

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

returnsCPR_maybe :: DmdResult -> Maybe ConTag #

newtype StrictSig #

Constructors

StrictSig DmdType |

Instances

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

mkStrictSig :: DmdType -> StrictSig #

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

nopSig :: StrictSig #

botSig :: StrictSig #

cprProdSig :: Arity -> StrictSig #

isNopSig :: StrictSig -> Bool #

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

increaseStrictSigArity :: Int -> StrictSig -> StrictSig #

seqDemand :: Demand -> () #

seqDemandList :: [Demand] -> () #

seqDmdType :: DmdType -> () #

seqStrictSig :: StrictSig -> () #

evalDmd :: Demand #

cleanEvalDmd :: CleanDemand #

cleanEvalProdDmd :: Arity -> CleanDemand #

isStrictDmd :: Demand -> Bool #

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

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

deferAfterIO :: DmdType -> DmdType #

postProcessUnsat :: DmdShell -> DmdType -> DmdType #

postProcessDmdType :: DmdShell -> DmdType -> BothDmdArg #

splitProdDmd_maybe :: Demand -> Maybe [Demand] #

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

mkCallDmd :: CleanDemand -> CleanDemand #

dmdTransformSig :: StrictSig -> CleanDemand -> DmdType #

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

dmdTransformDictSelSig :: StrictSig -> CleanDemand -> DmdType #

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

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

trimToType :: Demand -> TypeShape -> Demand #

data TypeShape #

Constructors

TsFun TypeShape |
TsProd [TypeShape] |
TsUnk |

Instances

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

useCount :: Use u -> Count #

isUsedOnce :: Demand -> Bool #

reuseEnv :: DmdEnv -> DmdEnv #

killUsageDemand :: DynFlags -> Demand -> Demand #

killUsageSig :: DynFlags -> StrictSig -> StrictSig #

zapUsageDemand :: Demand -> Demand #

strictifyDictDmd :: Type -> Demand -> Demand #