binary-orphans 1.0.1 → 1.0.2
raw patch · 4 files changed
+53/−18 lines, 4 filesdep +OneTupledep ~basedep ~binarydep ~semigroupsPVP ok
version bump matches the API change (PVP)
Dependencies added: OneTuple
Dependency ranges changed: base, binary, semigroups
API changes (from Hackage documentation)
+ Data.Binary.Orphans: instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Data.Tuple.Solo.Solo a)
Files
- CHANGELOG.md +4/−0
- binary-orphans.cabal +33/−18
- src/Data/Binary/Orphans.hs +14/−0
- test/Tests.hs +2/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 1.0.2++- Add `Solo` instance+ # 1.0.1 - Fix `MonadFail` instances shim
binary-orphans.cabal view
@@ -1,21 +1,32 @@-cabal-version: 1.12-name: binary-orphans-version: 1.0.1-synopsis: Compatibility package for binary; provides instances-category: Data, Binary, Parsing, Compatibility+cabal-version: 1.12+name: binary-orphans+version: 1.0.2+synopsis: Compatibility package for binary; provides instances+category: Data, Binary, Parsing, Compatibility description: This package provides instances defined in later versions of @binary@ package . Prior version 1 this packages provided instances for other packages. That functionality is moved to [binary-instances](https://hackage.haskell.org/package/binary-instances) package. -build-type: Simple-maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>-author: Oleg Grenrus <oleg.grenrus@iki.fi>-license: BSD3-license-file: LICENSE+build-type: Simple+maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>+author: Oleg Grenrus <oleg.grenrus@iki.fi>+license: BSD3+license-file: LICENSE tested-with:- GHC ==7.4.2 || ==7.6.3 || ==7.8.4 || ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1+ GHC ==7.4.2+ || ==7.6.3+ || ==7.8.4+ || ==7.10.3+ || ==8.0.2+ || ==8.2.2+ || ==8.4.4+ || ==8.6.5+ || ==8.8.4+ || ==8.10.4+ || ==9.0.1+ || ==9.2.1 extra-source-files: CHANGELOG.md @@ -29,8 +40,8 @@ exposed-modules: Data.Binary.Orphans other-extensions: CPP build-depends:- base >=4.5 && <4.14- , binary >=0.5.1.0 && <0.6 || >=0.7.1.0 && <0.8 || >=0.8.3.0 && <0.8.7+ base >=4.5 && <4.17+ , binary >=0.5.1.0 && <0.6 || >=0.7.1.0 && <0.8 || >=0.8.3.0 && <0.8.10 , transformers >=0.3.0.0 && <0.7 if !impl(ghc >=7.10)@@ -38,9 +49,12 @@ build-depends: void >=0.7.3 && <0.8 if !impl(ghc >=8.0)- build-depends: fail ==4.9.*- build-depends: semigroups >=0.18.5 && <0.19.1+ build-depends: fail >=4.9 && <4.10+ build-depends: semigroups >=0.18.5 && <0.19.2 + if !impl(ghc >=9.2)+ build-depends: OneTuple >=0.3 && <0.4+ test-suite binary-orphans-test default-language: Haskell2010 type: exitcode-stdio-1.0@@ -51,11 +65,12 @@ base , binary , binary-orphans- , QuickCheck >=2.13.1 && <2.14+ , OneTuple >=0.3 && <0.4+ , QuickCheck >=2.13.1 && <2.15 , quickcheck-instances >=0.3.21 && <0.4- , tasty >=0.10.1.2 && <1.3+ , tagged >=0.8.6 && <0.8.7+ , tasty >=0.10.1.2 && <1.5 , tasty-quickcheck >=0.8.3.2 && <0.11- , tagged >=0.8.6 && <0.8.7 if !impl(ghc >=8.0) build-depends: semigroups
src/Data/Binary/Orphans.hs view
@@ -28,6 +28,12 @@ import GHC.Fingerprint (Fingerprint (..)) import Numeric.Natural (Natural) +#if MIN_VERSION_base(4,16,0)+import Data.Tuple (Solo (..))+#else+import Data.Tuple.Solo (Solo (..))+#endif+ ------------------------------------------------------------------------------- -- binary-0.7.1.0 -------------------------------------------------------------------------------@@ -323,3 +329,11 @@ #endif #endif++-------------------------------------------------------------------------------+-- future-binary+-------------------------------------------------------------------------------++instance Binary a => Binary (Solo a) where+ put (Solo x) = put x+ get = fmap Solo get
test/Tests.hs view
@@ -6,6 +6,7 @@ import Data.Monoid (Sum) import Data.Proxy import Data.Semigroup (Min (..))+import Data.Tuple.Solo (Solo (..)) import Numeric.Natural (Natural) import Test.QuickCheck (Property, (===)) import Test.QuickCheck.Instances ()@@ -20,6 +21,7 @@ [ testProperty "Natural" $ roundtrip (Proxy :: Proxy Natural) , testProperty "Sum Int" $ roundtrip (Proxy :: Proxy (Sum Int)) , testProperty "Min Int" $ roundtrip (Proxy :: Proxy (Min Int))+ , testProperty "Solo Int" $ roundtrip (Proxy :: Proxy (Solo Int)) ] roundtrip :: (Eq a, Show a, Binary a) => Proxy a -> a -> Property