summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwardKmett <>2014-06-08 09:01:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-06-08 09:01:00 (GMT)
commitfe13259ddeeadc6c1373050f89d6456bd7187a5d (patch)
tree1f7cecf8b95b025afa5c672c45e6b9fcaace8255
parent26e37c411287d3d53d6c4ec570f9d11851aded45 (diff)
version 0.14.0.20.14.0.2
-rw-r--r--bytes.cabal2
-rw-r--r--src/Data/Bytes/Serial.hs9
2 files changed, 9 insertions, 2 deletions
diff --git a/bytes.cabal b/bytes.cabal
index 94743e9..188e655 100644
--- a/bytes.cabal
+++ b/bytes.cabal
@@ -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
diff --git a/src/Data/Bytes/Serial.hs b/src/Data/Bytes/Serial.hs
index 055e9ef..23074db 100644
--- a/src/Data/Bytes/Serial.hs
+++ b/src/Data/Bytes/Serial.hs
@@ -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.ByteString as Strict
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 @@ instance Serial Ordering where
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 @@ instance Serial a => Serial (Constant a b) where
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