ghc-8.6.5: The GHC API

Safe HaskellNone
LanguageHaskell2010

Demand

Synopsis

Documentation

data StrDmd #

Vanilla strictness domain

Instances
Eq StrDmd # 
Instance details

Defined in Demand

Methods

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

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

Show StrDmd # 
Instance details

Defined in Demand

Outputable StrDmd # 
Instance details

Defined in Demand

Methods

ppr :: StrDmd -> SDoc #

pprPrec :: Rational -> StrDmd -> SDoc #

Binary StrDmd # 
Instance details

Defined in Demand

Methods

put_ :: BinHandle -> StrDmd -> IO () #

put :: BinHandle -> StrDmd -> IO (Bin StrDmd) #

get :: BinHandle -> IO StrDmd #

data UseDmd #

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

Defined in Demand

Methods

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

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

Show UseDmd # 
Instance details

Defined in Demand

Outputable UseDmd # 
Instance details

Defined in Demand

Methods

ppr :: UseDmd -> SDoc #

pprPrec :: Rational -> UseDmd -> SDoc #

Binary UseDmd # 
Instance details

Defined in Demand

Methods

put_ :: BinHandle -> UseDmd -> IO () #

put :: BinHandle -> UseDmd -> IO (Bin UseDmd) #

get :: BinHandle -> IO UseDmd #

data Count #

Abstract counting of usages

Instances
Eq Count # 
Instance details

Defined in Demand

Methods

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

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

Show Count # 
Instance details

Defined in Demand

Outputable Count # 
Instance details

Defined in Demand

Methods

ppr :: Count -> SDoc #

pprPrec :: Rational -> Count -> SDoc #

Binary Count # 
Instance details

Defined in Demand

Methods

put_ :: BinHandle -> Count -> IO () #

put :: BinHandle -> Count -> IO (Bin Count) #

get :: BinHandle -> IO Count #

type Demand = JointDmd ArgStr ArgUse #

type CleanDemand = JointDmd StrDmd UseDmd #

getStrDmd :: JointDmd s u -> s #

getUseDmd :: JointDmd s u -> u #

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

data DmdType #

Constructors

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

Defined in Demand

Methods

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

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

Outputable DmdType # 
Instance details

Defined in Demand

Methods

ppr :: DmdType -> SDoc #

pprPrec :: Rational -> DmdType -> SDoc #

Binary DmdType # 
Instance details

Defined in Demand

type BothDmdArg = (DmdEnv, Termination ()) #

type DmdResult = Termination CPRResult #

data CPRResult #

Instances
Eq CPRResult # 
Instance details

Defined in Demand

Show CPRResult # 
Instance details

Defined in Demand

Outputable CPRResult # 
Instance details

Defined in Demand

Binary CPRResult # 
Instance details

Defined in Demand

Binary DmdResult # 
Instance details

Defined in Demand

newtype StrictSig #

Constructors

StrictSig DmdType 
Instances
Eq StrictSig # 
Instance details

Defined in Demand

Outputable StrictSig # 
Instance details

Defined in Demand

Binary StrictSig # 
Instance details

Defined in Demand

seqDemand :: Demand -> () #

postProcessUnsat :: DmdShell -> DmdType -> DmdType #

data TypeShape #

Instances
Outputable TypeShape # 
Instance details

Defined in Demand

useCount :: Use u -> Count #

zapUsedOnceDemand :: Demand -> Demand #

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

zapUsedOnceSig :: StrictSig -> StrictSig #

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