[project @ 2001-10-25 09:59:39 by simonpj]
authorsimonpj <unknown>
Thu, 25 Oct 2001 09:59:40 +0000 (09:59 +0000)
committersimonpj <unknown>
Thu, 25 Oct 2001 09:59:40 +0000 (09:59 +0000)
Move defer from NewDemand to DmdAnal

ghc/compiler/basicTypes/NewDemand.lhs
ghc/compiler/stranal/DmdAnal.lhs

index 532ad46..e401609 100644 (file)
@@ -6,7 +6,7 @@
 \begin{code}
 module NewDemand(
        Demand(..), Keepity(..), 
-       mkSeq, topDmd, lazyDmd, seqDmd, evalDmd, isStrictDmd, defer,
+       mkSeq, topDmd, lazyDmd, seqDmd, evalDmd, isStrictDmd, 
 
        DmdType(..), topDmdType, botDmdType, mkDmdType, mkTopDmdType, 
                dmdTypeDepth, dmdTypeRes,
@@ -221,18 +221,6 @@ mkSeq k ds | all is_absent ds = Seq k []
             is_absent Abs = True
             is_absent d   = False
 
-defer :: Demand -> Demand
--- Computes (Abs `lub` d)
--- For the Bot case consider
---     f x y = if ... then x else error x
---   Then for y we get Abs `lub` Bot, and we really
---   want Abs overall
-defer Bot          = Abs
-defer Abs          = Abs
-defer (Seq Keep ds) = Lazy
-defer (Seq _    ds) = Seq Defer ds
-defer d                    = Lazy
-
 topDmd, lazyDmd, seqDmd :: Demand
 topDmd  = Lazy         -- The most uninformative demand
 lazyDmd = Lazy
index d0ac19e..714d8ed 100644 (file)
@@ -919,6 +919,19 @@ lub (Seq k1 ds1) (Seq k2 ds2)
 
 lub d1@(Seq _ _) d2 = d2 `lub` d1
 
+
+defer :: Demand -> Demand
+-- Computes (Abs `lub` d)
+-- For the Bot case consider
+--     f x y = if ... then x else error x
+--   Then for y we get Abs `lub` Bot, and we really
+--   want Abs overall
+defer Bot          = Abs
+defer Abs          = Abs
+defer (Seq Keep ds) = Lazy
+defer (Seq _    ds) = Seq Defer ds
+defer d                    = Lazy
+
 ---------------
 both :: Demand -> Demand -> Demand