[commit: packages/hpc] master: Fix compilation with GHC < 7.6 (88b389f)

git at git.haskell.org git at git.haskell.org
Tue May 3 16:26:15 UTC 2016


Repository : ssh://git@git.haskell.org/hpc

On branch  : master
Link       : http://git.haskell.org/packages/hpc.git/commitdiff/88b389f368d1222078ee9592236b107d061cd5f2

>---------------------------------------------------------------

commit 88b389f368d1222078ee9592236b107d061cd5f2
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Tue May 3 17:34:31 2016 +0200

    Fix compilation with GHC < 7.6


>---------------------------------------------------------------

88b389f368d1222078ee9592236b107d061cd5f2
 Trace/Hpc/Mix.hs | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/Trace/Hpc/Mix.hs b/Trace/Hpc/Mix.hs
index 2066284..709e70c 100644
--- a/Trace/Hpc/Mix.hs
+++ b/Trace/Hpc/Mix.hs
@@ -26,18 +26,14 @@ import Data.List
 import Data.Maybe (catMaybes, fromMaybe)
 import Data.Time (UTCTime)
 import Data.Tree
-
-import System.FilePath
-
 #if MIN_VERSION_base(4,6,0)
 import Text.Read (readMaybe)
 #else
-readMaybe :: Read a => String -> Maybe a
-readMaybe s = case reads s of
-  [(x, s')] | all isSpace s' -> Just x
-  _                          -> Nothing
+import Data.Char (isSpace)
 #endif
 
+import System.FilePath
+
 -- a module index records the attributes of each tick-box that has
 -- been introduced in that module, accessed by tick-number position
 -- in the list
@@ -45,6 +41,13 @@ readMaybe s = case reads s of
 import Trace.Hpc.Util (HpcPos, insideHpcPos, Hash, HpcHash(..), catchIO)
 import Trace.Hpc.Tix
 
+#if !MIN_VERSION_base(4,6,0)
+readMaybe :: Read a => String -> Maybe a
+readMaybe s = case reads s of
+  [(x, s')] | all isSpace s' -> Just x
+  _                          -> Nothing
+#endif
+
 -- | 'Mix' is the information about a modules static properties, like
 -- location of Tix's in a file.
 --



More information about the ghc-commits mailing list