Skip to content
Snippets Groups Projects
Commit 0ad03de5 authored by BinderDavid's avatar BinderDavid
Browse files

Switch the function "readMix" from lazy "readFile" to strict "readFileUtf8",...

Switch the function "readMix" from lazy "readFile" to strict "readFileUtf8", similar to how "readTix" is implemented
parent 6cb04938
No related branches found
No related tags found
No related merge requests found
Pipeline #84873 passed
...@@ -28,7 +28,7 @@ import System.FilePath ...@@ -28,7 +28,7 @@ import System.FilePath
-- been introduced in that module, accessed by tick-number position -- been introduced in that module, accessed by tick-number position
-- in the list -- in the list
import Trace.Hpc.Util (HpcPos, insideHpcPos, Hash, HpcHash(..), catchIO) import Trace.Hpc.Util (HpcPos, insideHpcPos, Hash, HpcHash(..), catchIO, readFileUtf8)
import Trace.Hpc.Tix import Trace.Hpc.Tix
-- | 'Mix' is the information about a modules static properties, like -- | 'Mix' is the information about a modules static properties, like
...@@ -93,7 +93,7 @@ readMix dirNames mod' = do ...@@ -93,7 +93,7 @@ readMix dirNames mod' = do
res <- sequence [ (do let mixPath = mixName dirName modName res <- sequence [ (do let mixPath = mixName dirName modName
parseError = error ("can not parse " ++ mixPath) parseError = error ("can not parse " ++ mixPath)
parse = fromMaybe parseError . readMaybe parse = fromMaybe parseError . readMaybe
mix <- parse `fmap` readFile mixPath mix <- parse `fmap` readFileUtf8 mixPath
case mod' of case mod' of
Left _ -> return $ Just mix -- Bypass hash check Left _ -> return $ Just mix -- Bypass hash check
Right tix -> return $ checkHash tix mix mixPath) Right tix -> return $ checkHash tix mix mixPath)
......
# Changelog for [`hpc` package](http://hackage.haskell.org/package/hpc) # Changelog for [`hpc` package](http://hackage.haskell.org/package/hpc)
## 0.7.0.0 *July 2023* ## 0.7.0.0 *August 2023*
* The function `readMix` no longer uses lazyIO to read `.mix` files, which is consistent with the behaviour of the `readTix` function.
* The import of the modules from this package is no longer considered safe, since we use functions from the `System.Directory` module from the `directory` package which is no longer considered safe beginning from version `1.3.8`. * The import of the modules from this package is no longer considered safe, since we use functions from the `System.Directory` module from the `directory` package which is no longer considered safe beginning from version `1.3.8`.
* Replace uses of `String` by `FilePath` in functions `readTix`, `writeTix`, `getTixFileName`, `readMix` and `mixCreate`. * Replace uses of `String` by `FilePath` in functions `readTix`, `writeTix`, `getTixFileName`, `readMix` and `mixCreate`.
* Remove support for version of GHC below 8.6 * Remove support for version of GHC below 8.6
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment