Skip to content
Snippets Groups Projects
Commit 88b389f3 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Fix compilation with GHC < 7.6

parent 144d5374
No related branches found
Tags v0.6.0.3
No related merge requests found
...@@ -26,18 +26,14 @@ import Data.List ...@@ -26,18 +26,14 @@ import Data.List
import Data.Maybe (catMaybes, fromMaybe) import Data.Maybe (catMaybes, fromMaybe)
import Data.Time (UTCTime) import Data.Time (UTCTime)
import Data.Tree import Data.Tree
import System.FilePath
#if MIN_VERSION_base(4,6,0) #if MIN_VERSION_base(4,6,0)
import Text.Read (readMaybe) import Text.Read (readMaybe)
#else #else
readMaybe :: Read a => String -> Maybe a import Data.Char (isSpace)
readMaybe s = case reads s of
[(x, s')] | all isSpace s' -> Just x
_ -> Nothing
#endif #endif
import System.FilePath
-- a module index records the attributes of each tick-box that has -- a module index records the attributes of each tick-box that has
-- 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
...@@ -45,6 +41,13 @@ readMaybe s = case reads s of ...@@ -45,6 +41,13 @@ readMaybe s = case reads s of
import Trace.Hpc.Util (HpcPos, insideHpcPos, Hash, HpcHash(..), catchIO) import Trace.Hpc.Util (HpcPos, insideHpcPos, Hash, HpcHash(..), catchIO)
import Trace.Hpc.Tix 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 -- | 'Mix' is the information about a modules static properties, like
-- location of Tix's in a file. -- location of Tix's in a file.
-- --
......
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