ghc-8.4.0.20171214: The GHC API

Safe HaskellNone
LanguageHaskell2010

Demand

Synopsis

Documentation

data StrDmd Source #

Vanilla strictness domain

Instances
Eq StrDmd # 
Instance details

Methods

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

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

Show StrDmd # 
Instance details
Outputable StrDmd # 
Instance details
Binary StrDmd # 
Instance details

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. Roughly U(AAA) e.g. the usage of x in x seq e A polymorphic demand: used for values of all types, including a type variable 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
Eq UseDmd # 
Instance details

Methods

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

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

Show UseDmd # 
Instance details
Outputable UseDmd # 
Instance details
Binary UseDmd # 
Instance details

data Count Source #

Abstract counting of usages

Instances
Eq Count # 
Instance details

Methods

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

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

Show Count # 
Instance details
Outputable Count # 
Instance details
Binary Count # 
Instance details

type Demand = JointDmd ArgStr ArgUse Source #

type CleanDemand = JointDmd StrDmd UseDmd Source #

getStrDmd :: JointDmd s u -> s Source #

getUseDmd :: JointDmd s u -> u Source #

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

data DmdType Source #

Constructors

DmdType DmdEnv [Demand] DmdResult 
Instances
Eq DmdType # 
Instance details

Methods

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

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

Outputable DmdType # 
Instance details
Binary DmdType # 
Instance details

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

type DmdResult = Termination CPRResult Source #

data CPRResult Source #

Instances
Eq CPRResult # 
Instance details
Show CPRResult # 
Instance details
Outputable CPRResult # 
Instance details
Binary CPRResult # 
Instance details
Binary DmdResult # 
Instance details

newtype StrictSig Source #

Constructors

StrictSig DmdType 
Instances
Eq StrictSig # 
Instance details
Outputable StrictSig # 
Instance details
Binary StrictSig # 
Instance details

data TypeShape Source #

Instances
Outputable TypeShape # 
Instance details

useCount :: Use u -> Count 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