# HG changeset patch
# User unc0rr
# Date 1290279901 -10800
# Node ID 615a3e7bd85035257f1b838c824b858a30989831
# Parent  0a7158f26ffa42c5e5b37393715fe7c82dd5fff6
It works, though wastes too much of CPU

diff -r 0a7158f26ffa -r 615a3e7bd850 tools/unitCycles.hs
--- a/tools/unitCycles.hs	Thu Nov 18 16:58:08 2010 -0500
+++ b/tools/unitCycles.hs	Sat Nov 20 22:05:01 2010 +0300
@@ -25,10 +25,10 @@
 myf d = unlines . map (findCycle . fst) $ d
     where
     findCycle :: String -> String
-    findCycle searched = intercalate ", " $ fc searched [searched]
+    findCycle searched = searched ++ ": " ++ (intercalate ", " $ fc searched [])
         where
         fc :: String -> [String] -> [String]
-        fc curSearch visited = let uses = curSearch `lookup` d in if isNothing uses then [] else concatMap t $ fromJust uses
+        fc curSearch visited = let uses = curSearch `lookup` d; res = dropWhile null . map t $ fromJust uses in if isNothing uses || null res then [] else head res
             where
             t u =
                 if u == searched then