ghc-7.10.2: The GHC API

Safe Haskell | None
Language | Haskell2010

Demand

# Documentation

data StrDmd Source

Instances

Eq StrDmd |
Show StrDmd |
Outputable StrDmd |
Binary StrDmd |

data UseDmd Source

Constructors

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

Instances

Eq UseDmd |
Show UseDmd |
Outputable UseDmd |
Binary UseDmd |

data Count Source

Constructors

One |
Many |

Instances

Eq Count |
Show Count |
Outputable Count |
Binary Count |

countOnce :: Count Source

countMany :: Count Source

type Demand = JointDmd Source

data CleanDemand Source

Instances

Eq CleanDemand |
Show CleanDemand |
Outputable CleanDemand |

mkProdDmd :: [JointDmd] -> CleanDemand Source

mkOnceUsedDmd :: CleanDemand -> JointDmd Source

mkManyUsedDmd :: CleanDemand -> JointDmd Source

mkHeadStrict :: CleanDemand -> CleanDemand Source

oneifyDmd :: JointDmd -> JointDmd Source

getUsage :: CleanDemand -> UseDmd Source

toCleanDmd :: Demand -> Type -> (CleanDemand, DeferAndUseM) Source

absDmd :: JointDmd Source

topDmd :: JointDmd Source

botDmd :: JointDmd Source

seqDmd :: JointDmd Source

lubDmd :: JointDmd -> JointDmd -> JointDmd Source

bothDmd :: JointDmd -> JointDmd -> JointDmd Source

apply1Dmd :: Demand Source

apply2Dmd :: Demand Source

isTopDmd :: JointDmd -> Bool Source

isBotDmd :: JointDmd -> Bool Source

isAbsDmd :: JointDmd -> Bool Source

isSeqDmd :: JointDmd -> Bool Source

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

cleanUseDmd_maybe :: JointDmd -> Maybe UseDmd Source

strictenDmd :: JointDmd -> CleanDemand Source

bothCleanDmd :: CleanDemand -> CleanDemand -> CleanDemand Source

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

data DmdType Source

Constructors

DmdType DmdEnv [Demand] DmdResult |

Instances

Eq DmdType |
Outputable DmdType |
Binary DmdType |

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 |
Show CPRResult |
Outputable CPRResult |
Outputable DmdResult |
Binary CPRResult |
Binary DmdResult |

isBotRes :: DmdResult -> Bool Source

isTopRes :: DmdResult -> Bool Source

topRes :: DmdResult Source

botRes :: 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 |
Outputable StrictSig |
Binary StrictSig |

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 :: JointDmd -> () Source

seqDemandList :: [JointDmd] -> () Source

seqDmdType :: DmdType -> () Source

seqStrictSig :: StrictSig -> () Source

evalDmd :: JointDmd 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 :: DeferAndUse -> DmdType -> DmdType Source

postProcessDmdTypeM :: DeferAndUseM -> DmdType -> BothDmdArg Source

splitProdDmd_maybe :: JointDmd -> Maybe [JointDmd] Source

peelCallDmd :: CleanDemand -> (CleanDemand, DeferAndUse) Source

mkCallDmd :: CleanDemand -> CleanDemand Source

dmdTransformSig :: StrictSig -> CleanDemand -> DmdType Source

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

dmdTransformDictSelSig :: StrictSig -> CleanDemand -> DmdType Source

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

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

trimToType :: JointDmd -> TypeShape -> JointDmd Source

data TypeShape Source

Constructors

TsFun TypeShape |
TsProd [TypeShape] |
TsUnk |

Instances

Outputable TypeShape |

isSingleUsed :: JointDmd -> 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