Build and install inplace the count_lines and compareSizes utils
[ghc-hetmet.git] / utils / compare_sizes / Main.hs
similarity index 97%
rename from utils/compare_sizes/compareSizes.hs
rename to utils/compare_sizes/Main.hs
index a0397bf..302efaf 100644 (file)
@@ -89,7 +89,8 @@ getTree isFileInteresting root dir subdir
           dir' = dir <//> subdir
           doEntry :: FilePath -> IO (Maybe Tree)
           doEntry e = liftM Just (getTree isFileInteresting root dir' e)
-              `catch` \_ -> -- XXX Do this better
+            `catchIO` \_ -> -- XXX We ought to check this is a
+                            -- "not a directory" exception really
                       if isFileInteresting e
                       then do let fn = dir' <//> e
                               h <- openFile (root </> fn) ReadMode
@@ -98,6 +99,9 @@ getTree isFileInteresting root dir subdir
                               return $ Just $ File e fn size
                       else return Nothing
 
+catchIO :: IO a -> (IOError -> IO a) -> IO a
+catchIO = catch
+
 ----------------------------------------------------------------------
 -- Comparing the trees