[commit: ghc] wip/nested-cpr: Do not export DmdResult constructors in Demand.lhs (9fcf856)

git at git.haskell.org git at git.haskell.org
Thu Dec 12 17:57:05 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nested-cpr
Link       : http://ghc.haskell.org/trac/ghc/changeset/9fcf85608bd6c62a28404d9152be9d277b25a248/ghc

>---------------------------------------------------------------

commit 9fcf85608bd6c62a28404d9152be9d277b25a248
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Dec 9 16:56:32 2013 +0000

    Do not export DmdResult constructors in Demand.lhs


>---------------------------------------------------------------

9fcf85608bd6c62a28404d9152be9d277b25a248
 compiler/basicTypes/Demand.lhs |   20 ++++++++++----------
 compiler/basicTypes/MkId.lhs   |    4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/compiler/basicTypes/Demand.lhs b/compiler/basicTypes/Demand.lhs
index 38ff2d2..fefbb8c 100644
--- a/compiler/basicTypes/Demand.lhs
+++ b/compiler/basicTypes/Demand.lhs
@@ -25,7 +25,7 @@ module Demand (
         DmdEnv, emptyDmdEnv,
         peelFV,
 
-        DmdResult(..), CPRResult(..),
+        DmdResult, CPRResult,
         isBotRes, isTopRes, resTypeArgDmd, 
         topRes, botRes, cprProdRes, vanillaCprProdRes, cprSumRes,
         appIsBottom, isBottomingSig, pprIfaceStrictSig, 
@@ -768,19 +768,19 @@ topRes, botRes :: DmdResult
 topRes = Dunno NoCPR
 botRes = Diverges
 
-cprSumRes :: ConTag -> CPRResult
-cprSumRes tag | opt_CprOff = NoCPR
-              | otherwise  = RetSum tag
+cprSumRes :: ConTag -> DmdResult
+cprSumRes tag | opt_CprOff = topRes
+              | otherwise  = Dunno $ RetSum tag
 
-cprProdRes :: [DmdType] -> CPRResult
+cprProdRes :: [DmdType] -> DmdResult
 cprProdRes _arg_tys
-  | opt_CprOff = NoCPR
-  | otherwise  = RetProd
+  | opt_CprOff = topRes
+  | otherwise  = Dunno $ RetProd
 
-vanillaCprProdRes :: Arity -> CPRResult
+vanillaCprProdRes :: Arity -> DmdResult
 vanillaCprProdRes _arity
-  | opt_CprOff = NoCPR
-  | otherwise  = RetProd
+  | opt_CprOff = topRes
+  | otherwise  = Dunno $ RetProd
 
 isTopRes :: DmdResult -> Bool
 isTopRes (Dunno NoCPR) = True
diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs
index 6120b56..604163f 100644
--- a/compiler/basicTypes/MkId.lhs
+++ b/compiler/basicTypes/MkId.lhs
@@ -434,8 +434,8 @@ dataConCPR con
   , isVanillaDataCon con  -- No existentials 
   , wkr_arity > 0
   , wkr_arity <= mAX_CPR_SIZE
-  = if is_prod then Dunno (vanillaCprProdRes (dataConRepArity con))
-               else Dunno (cprSumRes (dataConTag con))
+  = if is_prod then vanillaCprProdRes (dataConRepArity con)
+               else cprSumRes (dataConTag con)
   | otherwise
   = topRes
   where



More information about the ghc-commits mailing list