testbench 0.2.1.0 → 0.2.1.1
raw patch · 3 files changed
+28/−18 lines, 3 filesdep +streaming-withdep −resourcetdep −streaming-bytestringdep ~basedep ~streamingPVP ok
version bump matches the API change (PVP)
Dependencies added: streaming-with
Dependencies removed: resourcet, streaming-bytestring
Dependency ranges changed: base, streaming
API changes (from Hackage documentation)
Files
- Changelog.md +7/−0
- src/TestBench/Evaluate.hs +16/−12
- testbench.cabal +5/−6
Changelog.md view
@@ -1,3 +1,10 @@+0.2.1.1 (6 February, 2018)+==========================++* Allow building with GHC 8.2.*++* Now requires streaming-0.2.*+ 0.2.1.0 (13 July, 2017) =======================
src/TestBench/Evaluate.hs view
@@ -45,12 +45,11 @@ import Data.Csv (DefaultOrdered(..), Field, Name, ToField, ToNamedRecord(..), ToRecord(..), header, namedRecord, record, toField) -import Control.Monad.Trans.Resource (runResourceT)-import qualified Data.ByteString.Streaming as B-import qualified Data.DList as DL-import Streaming (Of, Stream, hoist)-import Streaming.Cassava (encodeByNameDefault)-import qualified Streaming.Prelude as S+import qualified Data.DList as DL+import Streaming (Of, Stream)+import Streaming.Cassava (encodeByNameDefault)+import qualified Streaming.Prelude as S+import Streaming.With (writeBinaryFile) import Control.Applicative (liftA2) import Control.DeepSeq (NFData)@@ -132,12 +131,19 @@ evalForest cfg ef = do when (hasBench ep) initializeTime let ec = EC cfg ep printHeaders ep- (`evalStateT` zeroIndex) . maybeCSV . S.mapM printReturn $ toRows ec ef+ (`evalStateT` zeroIndex)+ . maybeCSV+ . S.mapM_ (liftIO . printRow ep)+ . S.copy+ $ toRows ec ef where ep = checkForest ef - printReturn r = liftIO (printRow ep r) *> return r-+ -- Ideally we would do the S.copy here only if we're writing to+ -- CSV; unfortunately, as we're not longer using ResourceT we+ -- don't have a MonadMask instance and thus can't use another+ -- Stream as the inner Monad; this /must/ be run after processing+ -- the stdout version. maybeCSV = maybe S.effects streamCSV (csvFile cfg) -- In reality, this type signature contains StateT, but that@@ -146,9 +152,7 @@ -- MonadThrow. -- streamCSV :: FilePath -> Stream (Of Row) IO () -> IO ()- streamCSV fp = runResourceT- . B.writeFile fp- . hoist lift+ streamCSV fp = writeBinaryFile fp . encodeByNameDefault . S.filter isLeaf
testbench.cabal view
@@ -1,5 +1,5 @@ name: testbench-version: 0.2.1.0+version: 0.2.1.1 synopsis: Create tests and benchmarks together description: { Test your benchmarks! Benchmark your tests!@@ -30,7 +30,7 @@ , Changelog.md cabal-version: >=1.10 -tested-with: GHC == 7.10.2, GHC == 8.0.1, GHC == 8.1.*+tested-with: GHC == 7.10.2, GHC == 8.0.1, GHC == 8.2.2, GHC == 8.3.* source-repository head type: git@@ -46,7 +46,7 @@ , TestBench.Evaluate , TestBench.LabelTree , Paths_testbench- build-depends: base >=4.7 && <4.11+ build-depends: base == 4.* , bytestring , cassava == 0.5.* , criterion >= 1.2.1.0 && < 1.3@@ -55,11 +55,10 @@ , HUnit >= 1.1 && < 1.7 , optparse-applicative >= 0.11.0.0 && < 0.15 , process >= 1.1.0.0 && < 1.7- , resourcet , statistics == 0.14.*- , streaming == 0.1.*- , streaming-bytestring == 0.1.*+ , streaming == 0.2.* , streaming-cassava == 0.1.*+ , streaming-with >= 0.1.0.0 && < 0.3 , temporary >= 1.1 && < 1.3 , transformers , weigh >= 0.0.4 && < 0.1