binary-orphans 0.1.5.0 → 0.1.5.1
raw patch · 4 files changed
+23/−2 lines, 4 filesdep +QuickCheckdep ~aesondep ~semigroupsdep ~taggedPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: QuickCheck
Dependency ranges changed: aeson, semigroups, tagged
API changes (from Hackage documentation)
- Data.Binary.Orphans: get :: Binary t => Get t
+ Data.Binary.Orphans: get :: Get t
- Data.Binary.Orphans: put :: Binary t => t -> Put
+ Data.Binary.Orphans: put :: t -> Put
- Data.Binary.Orphans: putList :: Binary t => [t] -> Put
+ Data.Binary.Orphans: putList :: [t] -> Put
Files
- CHANGELOG.md +3/−0
- binary-orphans.cabal +2/−1
- src/Data/Binary/Orphans.hs +3/−1
- test/Tests.hs +15/−0
CHANGELOG.md view
@@ -1,3 +1,6 @@+- 0.1.5.1+ - Fix issue with binary-0.8.4.* and GHC-7.*+ - 0.1.5.0 - Add `CI a` instance - Add `Alt f a` instance for `base >= 4.8.0.0`
binary-orphans.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: binary-orphans-version: 0.1.5.0+version: 0.1.5.1 synopsis: Orphan instances for binary description: `binary-orphans` defines orphan instances for types in some popular packages. category: Web@@ -73,6 +73,7 @@ , unordered-containers >=0.2.5.1 && <0.3 , vector >=0.10.12.3 && <0.12 , binary-orphans+ , QuickCheck >=2.7 && <2.9.2 , quickcheck-instances >=0.3.11 && <0.3.13 , tasty >=0.10.1.2 && <0.12 , tasty-quickcheck >=0.8.3.2 && <0.9
src/Data/Binary/Orphans.hs view
@@ -155,7 +155,7 @@ put = put . flip Time.diffAbsoluteTime Time.taiEpoch -#if !MIN_VERSION_binary(0,8,4) || !MIN_VERSION_base(4,9,0)+#if !MIN_VERSION_binary(0,8,4) ------------------------------------------------------------------------------- -- Monoid@@ -202,11 +202,13 @@ get = fmap Monoid.Alt get put = put . Monoid.getAlt #endif+#endif ------------------------------------------------------------------------------- -- semigroups ------------------------------------------------------------------------------- +#if !MIN_VERSION_binary(0,8,4) || !MIN_VERSION_base(4,9,0) -- | /Since: binary-orphans-0.1.3.0/ instance Binary a => Binary (Semigroup.Min a) where get = fmap Semigroup.Min get
test/Tests.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} module Main (main) where import Data.Binary@@ -14,6 +15,8 @@ import Data.Monoid (Sum) import Data.Text (Text) import Data.CaseInsensitive (CI)+import Data.Monoid (Sum(..))+import Data.Semigroup (Min(..)) import qualified Data.CaseInsensitive as CI @@ -33,6 +36,8 @@ , QC.testProperty "LocalTime" $ roundtrip (Proxy :: Proxy LocalTime) , QC.testProperty "AbsoluteTime" $ roundtrip (Proxy :: Proxy AbsoluteTime) , QC.testProperty "CI Text" $ roundtrip (Proxy :: Proxy (CI Text))+ , QC.testProperty "Sum Int" $ roundtrip (Proxy :: Proxy (Sum Int))+ , QC.testProperty "Min Int" $ roundtrip (Proxy :: Proxy (Min Int)) ] roundtrip :: (Eq a, Show a, Binary a) => Proxy a -> a -> Property@@ -40,3 +45,13 @@ instance (CI.FoldCase a, Arbitrary a) => Arbitrary (CI a) where arbitrary = fmap CI.mk arbitrary++instance Arbitrary a => Arbitrary (Min a) where+ arbitrary = fmap Min arbitrary+ shrink = fmap Min . shrink . getMin++#if !MIN_VERSION_QuickCheck(2,9,0)+instance Arbitrary a => Arbitrary (Sum a) where+ arbitrary = fmap Sum arbitrary+ shrink = fmap Sum . shrink . getSum+#endif