-instance Text Demand where
- readList str = read_em [] str
- showsPrec p d = showsPrecSDoc p (ppr d)
-#endif
-
-readDemands :: String ->
-
-read_em acc ('L' : xs) = read_em (WwLazy False : acc) xs
-read_em acc ('A' : xs) = read_em (WwLazy True : acc) xs
-read_em acc ('S' : xs) = read_em (WwStrict : acc) xs
-read_em acc ('P' : xs) = read_em (WwPrim : acc) xs
-read_em acc ('E' : xs) = read_em (WwEnum : acc) xs
-read_em acc (')' : xs) = [(reverse acc, xs)]
-read_em acc ( 'U' : '(' : xs) = do_unpack DataType True acc xs
-read_em acc ( 'u' : '(' : xs) = do_unpack DataType False acc xs
-read_em acc ( 'N' : '(' : xs) = do_unpack NewType True acc xs
-read_em acc ( 'n' : '(' : xs) = do_unpack NewType False acc xs
-read_em acc rest = [(reverse acc, rest)]
-
-do_unpack new_or_data wrapper_unpacks acc xs
- = case (read_em [] xs) of
- [(stuff, rest)] -> read_em (WwUnpack new_or_data wrapper_unpacks stuff : acc) rest
- _ -> pprPanic "Demand.do_unpack:" (ppr acc <+> dcolon <> text xs)
-
--------------------- END OF OMISSION ------------------------------ -}
+noStrictnessInfo = NoStrictnessInfo
+
+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 NoStrictnessInfo n = False
+
+ppStrictnessInfo NoStrictnessInfo = empty
+ppStrictnessInfo (StrictnessInfo wrapper_args bot) = hsep [pprDemands wrapper_args bot]