X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fhpc%2FHpcUtils.hs;h=5655f837f3e081556cd2fcbe2ac18dc53abaeefa;hp=0f566297822d87fbab24528b3c430320bc27f841;hb=b00e3a6c0a82a8af3238d677f798d812cd7fd49f;hpb=eb546347e5eace34612005c151121fcd1f32b257 diff --git a/utils/hpc/HpcUtils.hs b/utils/hpc/HpcUtils.hs index 0f56629..5655f83 100644 --- a/utils/hpc/HpcUtils.hs +++ b/utils/hpc/HpcUtils.hs @@ -1,7 +1,7 @@ module HpcUtils where import Trace.Hpc.Util -import qualified HpcMap as Map +import qualified Data.Map as Map -- turns \n into ' ' -- | grab's the text behind a HpcPos; @@ -23,9 +23,9 @@ readFileFromPath :: (String -> IO String) -> String -> [String] -> IO String readFileFromPath _ filename@('/':_) _ = readFile filename readFileFromPath err filename path0 = readTheFile path0 where - readTheFile [] = err $ "could not find " ++ show filename - ++ " in path " ++ show path0 - readTheFile (dir:dirs) = - catch (do str <- readFile (dir ++ "/" ++ filename) - return str) - (\ _ -> readTheFile dirs) + readTheFile [] = err $ "could not find " ++ show filename + ++ " in path " ++ show path0 + readTheFile (dir:dirs) = + catchIO (do str <- readFile (dir ++ "/" ++ filename) + return str) + (\ _ -> readTheFile dirs)