@@ -12,7 +12,6 @@ import Idris.Core.TT
1212import Idris.Core.Evaluate
1313
1414import Debug.Trace
15−import System.IO.Unsafe
1615
1716import Control.Arrow
1817import Control.Applicative
@@ -63,13 +62,8 @@ minimalUsage = gather . forwardChain
6362
6463forwardChain :: Deps -> Set Node
6564forwardChain deps
66− | Just trivials <- M.lookup S.empty deps
67− , ("==>", S.toList trivials) `traceShow` False = undefined
68−
6965 | Just trivials <- M.lookup S.empty deps
7066 = trivials `S.union` forwardChain (remove trivials . M.delete S.empty $ deps)
71−
72− | unsafePerformIO prn `seq` False = undefined
7367 | otherwise = S.empty
7468 where
7569 -- Remove the given nodes from the Deps entirely,
@@ -77,11 +71,6 @@ forwardChain deps
7771 remove :: Set Node -> Deps -> Deps
7872 remove ns = M.mapKeysWith S.union (S.\\ ns)
7973
80− printItem (cond, deps) = show (S.toList cond) ++ " -> " ++ show (S.toList deps)
81− prn = do
82− putStrLn $ "SINGLES:\n" ++ unlines (map show . filter ((==1) . S.size) $ M.keys deps)
83− putStrLn $ "USAGE SUB-ANALYSIS:\n" ++ unlines (map printItem . M.toList $ deps)
84−
8574-- Build the dependency graph,
8675-- starting the depth-first search from a list of Names.
8776buildDepMap :: Context -> [Name] -> Deps
@@ -164,8 +153,7 @@ buildDepMap ctx ns = addPostulates $ dfs S.empty M.empty ns
164153 getDepsSC fn es vs ImpossibleCase = M.empty
165154 getDepsSC fn es vs (UnmatchedCase msg) = M.empty
166155 getDepsSC fn es vs (ProjCase t alt) = error "ProjCase not supported"
167− getDepsSC fn [] vs (STerm t) = getDepsTerm vs [] (S.singleton (fn, Result)) t
168− getDepsSC fn es vs (STerm t) | ("EXPAND",es,t,"==>",etaExpand es t) `traceShow` True = getDepsTerm vs [] (S.singleton (fn, Result)) (etaExpand es t)
156+ getDepsSC fn es vs (STerm t) = getDepsTerm vs [] (S.singleton (fn, Result)) (etaExpand es t)
169157 getDepsSC fn es vs (Case n alts) = unionMap (getDepsAlt fn es vs var) alts
170158 where
171159 var = fromMaybe (error $ "nonpatvar in case: " ++ show n) (M.lookup n vs)
@@ -221,9 +209,7 @@ buildDepMap ctx ns = addPostulates $ dfs S.empty M.empty ns
221209 P Bound n _ -> var n `ins` unionMap (getDepsTerm vs bs cd) args
222210
223211 -- we interpret applied lambdas as lets in order to reuse code here
224− Bind n (Lam ty) t ->
225− ("REFORM", app, "==>", lamToLet [] app) `traceShow`
226− getDepsTerm vs bs cd (lamToLet [] app)
212+ Bind n (Lam ty) t -> getDepsTerm vs bs cd (lamToLet [] app)
227213
228214 _ -> error $ "cannot analyse application of: " ++ show fun
229215 where