[project @ 2005-02-25 13:06:31 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Demand.lhs
index f42e1d7..a038a23 100644 (file)
@@ -4,6 +4,10 @@
 \section[Demand]{@Demand@: the amount of demand on a value}
 
 \begin{code}
+#ifndef OLD_STRICTNESS
+module Demand () where
+#else
+
 module Demand(
        Demand(..),
 
@@ -18,12 +22,12 @@ module Demand(
        ppStrictnessInfo, seqStrictnessInfo,
        isBottomingStrictness, appIsBottom,
 
-       StrictnessMark(..), isMarkedUnboxed, isMarkedStrict
      ) where
 
 #include "HsVersions.h"
 
 import Outputable
+import Util ( listLengthCmp )
 \end{code}
 
 
@@ -192,42 +196,13 @@ isBottomingStrictness (StrictnessInfo _ bot) = bot
 isBottomingStrictness NoStrictnessInfo       = False
 
 -- appIsBottom returns true if an application to n args would diverge
-appIsBottom (StrictnessInfo ds bot)   n = bot && (n >= length ds)
+appIsBottom (StrictnessInfo ds bot)   n = bot && (listLengthCmp ds n /=GT) -- not more than 'n' elts in 'ds'.
 appIsBottom  NoStrictnessInfo        n = False
 
 ppStrictnessInfo NoStrictnessInfo                 = empty
 ppStrictnessInfo (StrictnessInfo wrapper_args bot) = hsep [pprDemands wrapper_args bot]
 \end{code}
 
-
-%************************************************************************
-%*                                                                     *
-\subsection{Strictness indication}
-%*                                                                     *
-%************************************************************************
-
-The strictness annotations on types in data type declarations
-e.g.   data T = MkT !Int !(Bool,Bool)
-
 \begin{code}
-data StrictnessMark
-   = MarkedUserStrict  -- "!"  in a source decl
-   | MarkedStrict      -- "!"  in an interface decl: strict but not unboxed
-   | MarkedUnboxed     -- "!!" in an interface decl: unboxed 
-   | NotMarkedStrict   -- No annotation at all
-   deriving( Eq )
-
-isMarkedUnboxed MarkedUnboxed = True
-isMarkedUnboxed other        = False
-
-isMarkedStrict NotMarkedStrict = False
-isMarkedStrict other          = True   -- All others are strict
-
-instance Outputable StrictnessMark where
-  ppr MarkedUserStrict = ptext SLIT("!u")
-  ppr MarkedStrict     = ptext SLIT("!")
-  ppr MarkedUnboxed    = ptext SLIT("! !")
-  ppr NotMarkedStrict  = empty
+#endif /* OLD_STRICTNESS */
 \end{code}
-
-