From 4a02c9518841000a58a53b0f57aafcfd708760a5 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 25 Oct 2001 09:59:40 +0000 Subject: [PATCH] [project @ 2001-10-25 09:59:39 by simonpj] Move defer from NewDemand to DmdAnal --- ghc/compiler/basicTypes/NewDemand.lhs | 14 +------------- 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 532ad46..e401609 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 d0ac19e..714d8ed 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 -- 1.7.10.4