DmdEnv, emptyDmdEnv,
DmdResult(..), isBotRes, returnsCPR,
- StrictSig(..), mkStrictSig, topSig, botSig,
+ StrictSig(..), mkStrictSig, topSig, botSig, isTopSig,
splitStrictSig, strictSigResInfo,
pprIfaceStrictSig, appIsBottom, isBottomingSig
) where
topDmdType = DmdType emptyDmdEnv [] TopRes
botDmdType = DmdType emptyDmdEnv [] BotRes
+isTopDmdType :: DmdType -> Bool
+-- Only used on top-level types, hence the assert
+isTopDmdType (DmdType _ [] TopRes) = ASSERT( isEmptyVarEnv env) True
+isTopDmdType other = False
+
isBotRes :: DmdResult -> Bool
isBotRes BotRes = True
isBotRes other = False
strictSigResInfo :: StrictSig -> DmdResult
strictSigResInfo (StrictSig (DmdType _ _ res)) = res
+isTopSig (StrictSig ty) = isTopDmdType ty
+
topSig = StrictSig topDmdType
botSig = StrictSig botDmdType