bytes 0.14.0.1 → 0.14.0.2
raw patch · 2 files changed
+9/−2 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- bytes.cabal +1/−1
- src/Data/Bytes/Serial.hs +8/−1
bytes.cabal view
@@ -1,6 +1,6 @@ name: bytes category: Data, Serialization-version: 0.14.0.1+version: 0.14.0.2 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Data/Bytes/Serial.hs view
@@ -10,6 +10,9 @@ #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Trustworthy #-} #endif+#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett 2013@@ -58,7 +61,9 @@ import Data.Int import Data.Bits import Data.Monoid as Monoid+#if MIN_VERSION_base(4, 6, 0) import Data.Ord (Down(..))+#endif import Data.Functor.Identity as Functor import Data.Functor.Constant as Functor import Data.Functor.Product as Functor@@ -475,9 +480,11 @@ serialize = serialize . (fromIntegral::Int -> Int8) . fromEnum deserialize = (toEnum . (fromIntegral::Int8 -> Int)) `liftM` deserialize +#if MIN_VERSION_base(4, 6, 0) instance Serial a => Serial (Down a) where serialize (Down a) = serialize a deserialize = Down `liftM` deserialize+#endif instance Serial Version where serialize (Version vb ts) = serialize (fmap VarInt vb, ts)@@ -496,7 +503,7 @@ serialize = serialize . getConstant deserialize = Constant `liftM` deserialize -instance (Serial (f a), Serial (g a)) => Serial (Functor.Product f g a) where +instance (Serial (f a), Serial (g a)) => Serial (Functor.Product f g a) where serialize (Pair f g) = serialize (f, g) deserialize = uncurry Pair `liftM` deserialize