summaryrefslogtreecommitdiff
path: root/utils/hpc/HpcUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hpc/HpcUtils.hs')
-rw-r--r--utils/hpc/HpcUtils.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/hpc/HpcUtils.hs b/utils/hpc/HpcUtils.hs
index 6ee44b1ae6..da62f4a364 100644
--- a/utils/hpc/HpcUtils.hs
+++ b/utils/hpc/HpcUtils.hs
@@ -1,6 +1,6 @@
module HpcUtils where
-import Trace.Hpc.Util
+import Trace.Hpc.Util (catchIO, HpcPos, fromHpcPos, readFileUtf8)
import qualified Data.Map as Map
import System.FilePath
@@ -25,12 +25,11 @@ grabHpcPos hsMap srcspan =
readFileFromPath :: (String -> IO String) -> String -> [String] -> IO String
-readFileFromPath _ filename@('/':_) _ = readFile filename
+readFileFromPath _ filename@('/':_) _ = readFileUtf8 filename
readFileFromPath err filename path0 = readTheFile path0
where
readTheFile [] = err $ "could not find " ++ show filename
++ " in path " ++ show path0
readTheFile (dir:dirs) =
- catchIO (do str <- readFile (dir </> filename)
- return str)
+ catchIO (readFileUtf8 (dir </> filename))
(\ _ -> readTheFile dirs)