binary-orphans 0.1.5.2 → 0.1.6.0
raw patch · 3 files changed
+15/−10 lines, 3 filesdep ~aesondep ~binaryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, binary
API changes (from Hackage documentation)
+ Data.Binary.Orphans: instance (Data.Hashable.Class.Hashable a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Data.Hashable.Class.Hashed a)
Files
- CHANGELOG.md +3/−0
- binary-orphans.cabal +2/−6
- src/Data/Binary/Orphans.hs +10/−4
CHANGELOG.md view
@@ -1,3 +1,6 @@+- 0.1.6.0+ - Add instance for `hashed` in `hashable >=1.2.5.0`+ - 0.1.5.2 - Fix issue with binary-0.5.*
binary-orphans.cabal view
@@ -1,9 +1,5 @@--- This file has been generated from package.yaml by hpack version 0.15.0.------ see: https://github.com/sol/hpack- name: binary-orphans-version: 0.1.5.2+version: 0.1.6.0 synopsis: Orphan instances for binary description: `binary-orphans` defines orphan instances for types in some popular packages. category: Web@@ -40,7 +36,7 @@ , text >=1.2.0.6 && <1.3 , time >=1.4.0.1 && <1.6.1 , unordered-containers >=0.2.5.1 && <0.3- , vector >=0.10.12.3 && <0.12+ , vector >=0.10.12.3 && <0.13 , text-binary >=0.1.0 && <0.3 , vector-binary-instances >=0.2.1.0 && <0.3 if !impl(ghc >= 8.0)
src/Data/Binary/Orphans.hs view
@@ -41,7 +41,7 @@ import qualified Data.Fixed as Fixed import qualified Data.HashMap.Lazy as HM import qualified Data.HashSet as HS-import Data.Hashable (Hashable)+import qualified Data.Hashable as Hashable import Data.List (unfoldr, foldl') import qualified Data.List.NonEmpty as NE import qualified Data.Monoid as Monoid@@ -82,14 +82,20 @@ put A.Null = put (5 :: Int) -instance (Hashable k, Eq k, Binary k, Binary v) => Binary (HM.HashMap k v) where+instance (Hashable.Hashable k, Eq k, Binary k, Binary v) => Binary (HM.HashMap k v) where get = fmap HM.fromList get put = put . HM.toList -instance (Hashable v, Eq v, Binary v) => Binary (HS.HashSet v) where+instance (Hashable.Hashable v, Eq v, Binary v) => Binary (HS.HashSet v) where get = fmap HS.fromList get put = put . HS.toList +#if MIN_VERSION_hashable(1,2,5)+instance (Hashable.Hashable a, Binary a) => Binary (Hashable.Hashed a) where+ get = fmap Hashable.hashed get+ put = put . Hashable.unhashed+#endif+ #if !(MIN_VERSION_scientific(0,3,4)) instance Binary S.Scientific where get = liftM2 S.scientific get get@@ -243,7 +249,7 @@ instance Binary m => Binary (Semigroup.WrappedMonoid m) where get = fmap Semigroup.WrapMonoid get put = put . Semigroup.unwrapMonoid- + -- | /Since: binary-orphans-0.1.5.0/ instance (Binary a, Binary b) => Binary (Semigroup.Arg a b) where get = liftM2 Semigroup.Arg get get