on 48cd64f help sign in
stackage/patching/patches/criterion-0.8.0.0.patch
55 lines 1.8 kB history raw
1diff -ru orig/Criterion/IO.hs new/Criterion/IO.hs
2--- orig/Criterion/IO.hs 2014-02-21 06:51:14.286525542 +0200
3+++ new/Criterion/IO.hs 2014-02-21 06:51:14.000000000 +0200
4@@ -1,4 +1,5 @@
5 {-# LANGUAGE OverloadedStrings #-}
6+{-# LANGUAGE CPP #-}
7 -- |
8 -- Module : Criterion.IO
9 -- Copyright : (c) 2009, 2010 Bryan O'Sullivan
10@@ -21,7 +22,11 @@
12 import Criterion.Types (ResultForest, ResultTree(..))
13 import Data.Binary (Binary(..), encode)
14+#if MIN_VERSION_binary(0, 6, 3)
15 import Data.Binary.Get (runGetOrFail)
16+#else
17+import Data.Binary.Get (runGetState)
18+#endif
19 import Data.Binary.Put (putByteString, putWord16be, runPut)
20 import Data.Version (Version(..))
21 import Paths_criterion (version)
22@@ -56,6 +61,7 @@
23 writeResults :: FilePath -> ResultForest -> IO ()
24 writeResults path rs = withFile path WriteMode (flip hPutResults rs)
26+#if MIN_VERSION_binary(0, 6, 3)
27 readAll :: Binary a => Handle -> IO [a]
28 readAll handle = do
29 let go bs
30@@ -64,3 +70,13 @@
31 Left (_, _, err) -> fail err
32 Right (bs', _, a) -> (a:) `fmap` go bs'
33 go =<< L.hGetContents handle
34+#else
35+readAll :: Binary a => Handle -> IO [a]
36+readAll handle = do
37+ let go i bs
38+ | L.null bs = return []
39+ | otherwise =
40+ let (a, bs', i') = runGetState get bs i
41+ in (a:) `fmap` go i' bs'
42+ go 0 =<< L.hGetContents handle
43+#endif
44diff -ru orig/criterion.cabal new/criterion.cabal
45--- orig/criterion.cabal 2014-02-21 06:51:14.314525543 +0200
46+++ new/criterion.cabal 2014-02-21 06:51:14.000000000 +0200
47@@ -58,7 +58,7 @@
48 build-depends:
49 aeson >= 0.3.2.12,
50 base < 5,
51- binary >= 0.6.3.0,
52+ binary >= 0.5.1.0,
53 bytestring >= 0.9 && < 1.0,
54 containers,
55 deepseq >= 1.1.0.0,