diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2016-07-26 12:08:59 +0200 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2016-08-25 18:24:43 +0200 |
commit | faaf31398110610a0f7068ca13d798d1ac21e02e (patch) | |
tree | 6221bb93fe8de309b570276cea1f66969e62471e /compiler/basicTypes/Demand.hs | |
parent | ec7fcfdda7f4655f4cc4399d1b3f4bc2543809db (diff) | |
download | haskell-faaf31398110610a0f7068ca13d798d1ac21e02e.tar.gz |
WwLib: Add strictness signature to "let x = absentError …"
indicating that it is bottom. This should help making the "empty cases"
lint error give less false alarms.
Diffstat (limited to 'compiler/basicTypes/Demand.hs')
-rw-r--r-- | compiler/basicTypes/Demand.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 2ada6b37b9..d79fa6eea9 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -35,7 +35,8 @@ module Demand ( vanillaCprProdRes, cprSumRes, appIsBottom, isBottomingSig, pprIfaceStrictSig, trimCPRInfo, returnsCPR_maybe, - StrictSig(..), mkStrictSig, mkClosedStrictSig, nopSig, botSig, cprProdSig, + StrictSig(..), mkStrictSig, mkClosedStrictSig, + nopSig, botSig, exnSig, cprProdSig, isTopSig, hasDemandEnvSig, splitStrictSig, strictSigDmdEnv, increaseStrictSigArity, @@ -1264,9 +1265,10 @@ emptyDmdEnv = emptyVarEnv -- (lazy, absent, no CPR information, no termination information). -- Note that it is ''not'' the top of the lattice (which would be "may use everything"), -- so it is (no longer) called topDmd -nopDmdType, botDmdType :: DmdType +nopDmdType, botDmdType, exnDmdType :: DmdType nopDmdType = DmdType emptyDmdEnv [] topRes botDmdType = DmdType emptyDmdEnv [] botRes +exnDmdType = DmdType emptyDmdEnv [] exnRes cprProdDmdType :: Arity -> DmdType cprProdDmdType arity @@ -1691,9 +1693,10 @@ isBottomingSig :: StrictSig -> Bool -- True if the signature diverges or throws an exception isBottomingSig (StrictSig (DmdType _ _ res)) = isBotRes res -nopSig, botSig :: StrictSig +nopSig, botSig, exnSig :: StrictSig nopSig = StrictSig nopDmdType botSig = StrictSig botDmdType +exnSig = StrictSig exnDmdType cprProdSig :: Arity -> StrictSig cprProdSig arity = StrictSig (cprProdDmdType arity) |