| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
GHC.Types.Cpr
Description
Types for the Constructed Product Result lattice.
GHC.Core.Opt.CprAnal and GHC.Core.Opt.WorkWrap.Utils
are its primary customers via idCprInfo.
Synopsis
- data Cpr where
- topCpr :: Cpr
- botCpr :: Cpr
- flatConCpr :: ConTag -> Cpr
- asConCpr :: Cpr -> Maybe (ConTag, [Cpr])
- data CprType = CprType {}
- topCprType :: CprType
- botCprType :: CprType
- flatConCprType :: ConTag -> CprType
- lubCprType :: CprType -> CprType -> CprType
- applyCprTy :: CprType -> Arity -> CprType
- abstractCprTy :: CprType -> CprType
- trimCprTy :: CprType -> CprType
- data UnpackConFieldsResult
- = AllFieldsSame !Cpr
- | ForeachField ![Cpr]
- unpackConFieldsCpr :: DataCon -> Cpr -> UnpackConFieldsResult
- newtype CprSig = CprSig {}
- topCprSig :: CprSig
- isTopCprSig :: CprSig -> Bool
- mkCprSigForArity :: Arity -> CprType -> CprSig
- mkCprSig :: Arity -> Cpr -> CprSig
- seqCprSig :: CprSig -> ()
Documentation
Instances
flatConCpr :: ConTag -> Cpr #
The abstract domain \(A_t\) from the original 'CPR for Haskell' paper.
Constructors
| CprType | |
Instances
| Binary CprType # | |
| Outputable CprType # | |
Defined in GHC.Types.Cpr | |
| Eq CprType # | |
topCprType :: CprType #
botCprType :: CprType #
flatConCprType :: ConTag -> CprType #
lubCprType :: CprType -> CprType -> CprType #
applyCprTy :: CprType -> Arity -> CprType #
abstractCprTy :: CprType -> CprType #
data UnpackConFieldsResult #
The result of unpackConFieldsCpr.
Constructors
| AllFieldsSame !Cpr | |
| ForeachField ![Cpr] |
unpackConFieldsCpr :: DataCon -> Cpr -> UnpackConFieldsResult #
Unpacks a ConCpr-shaped Cpr and returns the field Cprs wrapped in a
ForeachField. Otherwise, it returns AllFieldsSame with the appropriate
Cpr to assume for each field.
The use of UnpackConFieldsResult allows O(1) space for the common,
non-ConCpr case.
The arity of the wrapped CprType is the arity at which it is safe
to unleash. See Note [Understanding DmdType and StrictSig] in GHC.Types.Demand
Instances
| Binary CprSig # | |
| Outputable CprSig # | Only print the CPR result |
Defined in GHC.Types.Cpr | |
| Eq CprSig # | |
isTopCprSig :: CprSig -> Bool #
mkCprSigForArity :: Arity -> CprType -> CprSig #
Turns a CprType computed for the particular Arity into a CprSig
unleashable at that arity. See Note [Understanding DmdType and StrictSig] in
GHC.Types.Demand