1 2 -- ==========================================================-- 3 -- === Monster -- Enumerates the points in a lattice. ===-- 4 -- === Not part of the strictness analyser proper. ===-- 5 -- === Monster.hs ===-- 6 -- ==========================================================-- 7 8 module Monster where 9 import BaseDefs 10 import MyUtils 11 import Utils 12 import AbstractVals2 13 import SuccsAndPreds2 14 import AbstractMisc 15 16 pretty x 17 = f 0 0 x 18 where 19 f n h [] = "\n\nDone: " ++ show n ++ " total points, " ++ show h 20 ++ " height.\n" 21 f n h (x:xs) 22 = "\n " ++ show (h+1) ++ " contains " ++ show x 23 ++ f (n+x) (h+1) xs 24 25 main 26 = putStr banner >> 27 getContents >>= \ inText -> 28 let 29 d = first (head (reads inText)) 30 in 31 mySeq d (putStr ("\n\n" ++ pretty (map length (amAllUpSlices d)))) 32 where 33 banner = concat 34 [ "\nMonster 0.400r: generates all points in a domain.\n", 35 "Copyright (c) Julian Seward 1992", 36 "\n\nEnter the domain: " ] 37 38 39 -- ==========================================================-- 40 -- === end Monster.hs ===-- 41 -- ==========================================================--