binary-orphans 0.1.1.0 → 0.1.2.0
raw patch · 2 files changed
+20/−15 lines, 2 filesdep ~scientificdep ~tagged
Dependency ranges changed: scientific, tagged
Files
- binary-orphans.cabal +13/−13
- src/Data/Binary/Orphans.hs +7/−2
binary-orphans.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.7.0.+-- This file has been generated from package.yaml by hpack version 0.8.0. -- -- see: https://github.com/sol/hpack name: binary-orphans-version: 0.1.1.0+version: 0.1.2.0 synopsis: Orphan instances for binary description: `binary-orphans` defines orphan instances for types in some popular packages. category: Web@@ -31,13 +31,13 @@ ghc-options: -Wall -fno-warn-orphans build-depends: base >=4.7 && <4.9- , aeson >=0.8 && <0.10- , binary >=0.7 && <0.8+ , aeson >=0.8 && <0.10.1+ , binary >=0.7 && <0.7.7 , hashable >=1.2 && <1.3 , scientific >=0.3 && <0.4- , tagged >=0.7 && <0.9+ , tagged >=0.7 && <0.8.2 , text >=1.2 && <1.3- , time >=1.4 && <1.6+ , time >=1.4 && <1.5.1 , unordered-containers >=0.2 && <0.3 , vector >=0.10 && <0.12 , text-binary >=0.1 && <0.3@@ -54,17 +54,17 @@ ghc-options: -Wall -fno-warn-orphans build-depends: base >=4.7 && <4.9- , aeson >=0.8 && <0.10- , binary >=0.7 && <0.8+ , aeson >=0.8 && <0.10.1+ , binary >=0.7 && <0.7.7 , hashable >=1.2 && <1.3 , scientific >=0.3 && <0.4- , tagged >=0.7 && <0.9+ , tagged >=0.7 && <0.8.2 , text >=1.2 && <1.3- , time >=1.4 && <1.6+ , time >=1.4 && <1.5.1 , unordered-containers >=0.2 && <0.3 , vector >=0.10 && <0.12 , binary-orphans- , quickcheck-instances- , tasty- , tasty-quickcheck+ , quickcheck-instances >=0.3 && <0.4+ , tasty >=0.10 && <0.12+ , tasty-quickcheck >=0.8 && <0.9 default-language: Haskell2010
src/Data/Binary/Orphans.hs view
@@ -10,7 +10,7 @@ -- Provides orphan 'Binary' instances for types in various packages: -- -- * aeson--- * scientific+-- * scientific (prior to scientific-0.3.4.0) -- * tagged -- * text (through text-binary, or text >= 1.2.1) -- * time@@ -33,7 +33,6 @@ import qualified Data.HashSet as HS import Data.Hashable (Hashable) import qualified Data.Monoid as Monoid-import qualified Data.Scientific as S import qualified Data.Tagged as Tagged import qualified Data.Time as Time @@ -43,6 +42,10 @@ #endif import Data.Vector.Binary () +#if !(MIN_VERSION_scientific(0,3,4))+import qualified Data.Scientific as S+#endif+ instance Binary A.Value where get = do t <- get :: Get Int@@ -71,9 +74,11 @@ get = fmap HS.fromList get put = put . HS.toList +#if !(MIN_VERSION_scientific(0,3,4)) instance Binary S.Scientific where get = liftM2 S.scientific get get put s = put (S.coefficient s) >> put (S.base10Exponent s)+#endif instance Binary b => Binary (Tagged.Tagged s b) where put = put . Tagged.unTagged