packages feed

teardown 0.1.0.0 → 0.1.0.1

raw patch · 4 files changed

+30/−6 lines, 4 filesdep +deepseqdep ~criterionPVP ok

version bump matches the API change (PVP)

Dependencies added: deepseq

Dependency ranges changed: criterion

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -7,6 +7,12 @@ [1]: http://semver.org/spec/v2.0.0.html [2]: https://github.com/roman/Haskell-teardown/libraries/teardown/CHANGELOG.md ++## v0.1.0.1++* Add benchmark to compare with vanilla IO unit+* Bump version of `criterion` to `1.2`+ ## v0.1.0.0  > BREAKING CHANGES
benchmark/Main.hs view
@@ -1,9 +1,21 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE NoImplicitPrelude #-} module Main where +import Protolude+ import Criterion import Criterion.Main -import Lib (inc)+import Control.Teardown (newTeardown, teardown)  main :: IO ()-main = defaultMain [bench "inc 41" (whnf inc (41 :: Int))]+main = defaultMain [+    bgroup "simple IO unit return"+    [+      bench "without teardown" (whnfIO $ return ())+    , env+        (newTeardown "benchmark" $ (return () :: IO ()))+        (\unitTeardown -> bench "with teardown" (whnfIO $ void $ teardown unitTeardown))+    ]+  ]
src/Control/Teardown/Internal/Types.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE BangPatterns      #-} {-# LANGUAGE CPP               #-} {-# LANGUAGE DeriveGeneric     #-} {-# LANGUAGE NoImplicitPrelude #-}@@ -8,7 +9,8 @@ import Data.Time.Clock (NominalDiffTime)  #if MIN_VERSION_base(4,9,0)-import GHC.Generics (Generic)+import Control.DeepSeq (NFData (..))+import GHC.Generics    (Generic) #endif  --------------------------------------------------------------------------------@@ -51,6 +53,9 @@ newtype Teardown   = Teardown (IO TeardownResult)   deriving (Generic)++instance NFData Teardown where+  rnf !_ = ()  -- | A record that __is__ or __contains__ a 'Teardown' sub-routine should -- instantiate this typeclass
teardown.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.15.0.+-- This file has been generated from package.yaml by hpack version 0.17.0. -- -- see: https://github.com/sol/hpack  name:           teardown-version:        0.1.0.0+version:        0.1.0.1 synopsis:       Build composable, idempotent & transparent application cleanup sub-routines description:    Please see README.md category:       System@@ -37,6 +37,7 @@     , text >=1.2 && <1.3     , time >=1.5 && <1.7     , ansi-wl-pprint >=0.6 && <0.7+    , deepseq >=1.4 && <1.5   exposed-modules:       Control.Teardown   other-modules:@@ -96,6 +97,6 @@     , protolude >=0.1 && <0.2     , text >=1.2 && <1.3     , time >=1.5 && <1.7-    , criterion >=1.1 && <1.2+    , criterion >=1.1 && <1.3     , teardown   default-language: Haskell2010