diff options
author | simonpj <unknown> | 2001-10-25 09:59:40 +0000 |
---|---|---|
committer | simonpj <unknown> | 2001-10-25 09:59:40 +0000 |
commit | 4a02c9518841000a58a53b0f57aafcfd708760a5 (patch) | |
tree | 2db7b1dac4dd29f557d05b8a680458b197120dbf | |
parent | 2007c7e67ddea6e16f4c8e013a453b073232459a (diff) | |
download | haskell-4a02c9518841000a58a53b0f57aafcfd708760a5.tar.gz |
[project @ 2001-10-25 09:59:39 by simonpj]
Move defer from NewDemand to DmdAnal
-rw-r--r-- | ghc/compiler/basicTypes/NewDemand.lhs | 14 | ||||
-rw-r--r-- | ghc/compiler/stranal/DmdAnal.lhs | 13 |
2 files changed, 14 insertions, 13 deletions
diff --git a/ghc/compiler/basicTypes/NewDemand.lhs b/ghc/compiler/basicTypes/NewDemand.lhs index 532ad463a5..e401609858 100644 --- a/ghc/compiler/basicTypes/NewDemand.lhs +++ b/ghc/compiler/basicTypes/NewDemand.lhs @@ -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 diff --git a/ghc/compiler/stranal/DmdAnal.lhs b/ghc/compiler/stranal/DmdAnal.lhs index d0ac19e1de..714d8ed7dd 100644 --- a/ghc/compiler/stranal/DmdAnal.lhs +++ b/ghc/compiler/stranal/DmdAnal.lhs @@ -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 |