mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-14 00:08:28 +01:00
Include patch for criterion 0.8 and close #68
This commit is contained in:
parent
615bc8d3df
commit
ba4a1e8617
@ -314,9 +314,6 @@ defaultStablePackages ghcVer = unPackageMap $ execWriter $ do
|
||||
-- https://github.com/fpco/stackage/issues/46
|
||||
addRange "Michael Snoyman" "QuickCheck" "< 2.6"
|
||||
|
||||
-- https://github.com/fpco/stackage/issues/68
|
||||
addRange "Michael Snoyman" "criterion" "< 0.8"
|
||||
|
||||
-- https://github.com/fpco/stackage/issues/72
|
||||
addRange "Michael Snoyman" "HaXml" "< 1.24"
|
||||
|
||||
|
||||
55
patching/patches/criterion-0.8.0.0.patch
Normal file
55
patching/patches/criterion-0.8.0.0.patch
Normal file
@ -0,0 +1,55 @@
|
||||
diff -ru orig/Criterion/IO.hs new/Criterion/IO.hs
|
||||
--- orig/Criterion/IO.hs 2014-02-21 06:51:14.286525542 +0200
|
||||
+++ new/Criterion/IO.hs 2014-02-21 06:51:14.000000000 +0200
|
||||
@@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
+{-# LANGUAGE CPP #-}
|
||||
-- |
|
||||
-- Module : Criterion.IO
|
||||
-- Copyright : (c) 2009, 2010 Bryan O'Sullivan
|
||||
@@ -21,7 +22,11 @@
|
||||
|
||||
import Criterion.Types (ResultForest, ResultTree(..))
|
||||
import Data.Binary (Binary(..), encode)
|
||||
+#if MIN_VERSION_binary(0, 6, 3)
|
||||
import Data.Binary.Get (runGetOrFail)
|
||||
+#else
|
||||
+import Data.Binary.Get (runGetState)
|
||||
+#endif
|
||||
import Data.Binary.Put (putByteString, putWord16be, runPut)
|
||||
import Data.Version (Version(..))
|
||||
import Paths_criterion (version)
|
||||
@@ -56,6 +61,7 @@
|
||||
writeResults :: FilePath -> ResultForest -> IO ()
|
||||
writeResults path rs = withFile path WriteMode (flip hPutResults rs)
|
||||
|
||||
+#if MIN_VERSION_binary(0, 6, 3)
|
||||
readAll :: Binary a => Handle -> IO [a]
|
||||
readAll handle = do
|
||||
let go bs
|
||||
@@ -64,3 +70,13 @@
|
||||
Left (_, _, err) -> fail err
|
||||
Right (bs', _, a) -> (a:) `fmap` go bs'
|
||||
go =<< L.hGetContents handle
|
||||
+#else
|
||||
+readAll :: Binary a => Handle -> IO [a]
|
||||
+readAll handle = do
|
||||
+ let go i bs
|
||||
+ | L.null bs = return []
|
||||
+ | otherwise =
|
||||
+ let (a, bs', i') = runGetState get bs i
|
||||
+ in (a:) `fmap` go i' bs'
|
||||
+ go 0 =<< L.hGetContents handle
|
||||
+#endif
|
||||
diff -ru orig/criterion.cabal new/criterion.cabal
|
||||
--- orig/criterion.cabal 2014-02-21 06:51:14.314525543 +0200
|
||||
+++ new/criterion.cabal 2014-02-21 06:51:14.000000000 +0200
|
||||
@@ -58,7 +58,7 @@
|
||||
build-depends:
|
||||
aeson >= 0.3.2.12,
|
||||
base < 5,
|
||||
- binary >= 0.6.3.0,
|
||||
+ binary >= 0.5.1.0,
|
||||
bytestring >= 0.9 && < 1.0,
|
||||
containers,
|
||||
deepseq >= 1.1.0.0,
|
||||
Loading…
Reference in New Issue
Block a user