git.iko.soy/distributed-process
on master help sign in
Merge pull request #314 from bgamari/master

Allow binary 0.9 and GHC 8.2

commiteba4a4245eccd3e46eb14e39df5506eb53e6c005 authorFacundo Domínguez <facundominguez@gmail.com> dateTue 29 Aug 2017, 21:08 (9 years ago) parenteca7a01368e681
2 files changed+16−9
distributed-process.cabal+6−6 src/Control/Distributed/Process/Serializable.hs+10−3
distributed-process.cabal+6−6
@@ -42,7 +42,7 @@ flag old-locale
4242
4343Library
4444 Build-Depends: base >= 4.6 && < 5,
45− binary >= 0.6.3 && < 0.9,
45+ binary >= 0.6.3 && < 0.10,
4646 hashable >= 1.2.0.5 && < 1.3,
4747 network-transport >= 0.4.1.0 && < 0.6,
4848 stm >= 2.4 && < 2.5,
@@ -123,7 +123,7 @@ benchmark distributed-process-throughput
123123 distributed-process,
124124 network-transport-tcp >= 0.3 && < 0.7,
125125 bytestring >= 0.9 && < 0.11,
126− binary >= 0.6.3 && < 0.9
126+ binary >= 0.6.3 && < 0.10
127127 Main-Is: benchmarks/Throughput.hs
128128 ghc-options: -Wall
129129
@@ -133,7 +133,7 @@ benchmark distributed-process-latency
133133 distributed-process,
134134 network-transport-tcp >= 0.3 && < 0.7,
135135 bytestring >= 0.9 && < 0.11,
136− binary >= 0.6.3 && < 0.9
136+ binary >= 0.6.3 && < 0.10
137137 Main-Is: benchmarks/Latency.hs
138138 ghc-options: -Wall
139139
@@ -143,7 +143,7 @@ benchmark distributed-process-channels
143143 distributed-process,
144144 network-transport-tcp >= 0.3 && < 0.7,
145145 bytestring >= 0.9 && < 0.11,
146− binary >= 0.6.3 && < 0.9
146+ binary >= 0.6.3 && < 0.10
147147 Main-Is: benchmarks/Channels.hs
148148 ghc-options: -Wall
149149
@@ -153,7 +153,7 @@ benchmark distributed-process-spawns
153153 distributed-process,
154154 network-transport-tcp >= 0.3 && < 0.7,
155155 bytestring >= 0.9 && < 0.11,
156− binary >= 0.6.3 && < 0.9
156+ binary >= 0.6.3 && < 0.10
157157 Main-Is: benchmarks/Spawns.hs
158158 ghc-options: -Wall
159159
@@ -163,6 +163,6 @@ benchmark distributed-process-ring
163163 distributed-process,
164164 network-transport-tcp >= 0.3 && < 0.7,
165165 bytestring >= 0.9 && < 0.11,
166− binary >= 0.6.3 && < 0.9
166+ binary >= 0.6.3 && < 0.10
167167 Main-Is: benchmarks/ProcessRing.hs
168168 ghc-options: -Wall -threaded -O2 -rtsopts
src/Control/Distributed/Process/Serializable.hs+10−3
@@ -1,6 +1,7 @@
11{-# LANGUAGE DeriveDataTypeable #-}
22{-# LANGUAGE UndecidableInstances #-}
33{-# LANGUAGE FlexibleInstances #-}
4+{-# LANGUAGE ScopedTypeVariables #-}
45{-# LANGUAGE GADTs #-}
56{-# LANGUAGE CPP #-}
67module Control.Distributed.Process.Serializable
@@ -17,7 +18,11 @@ module Control.Distributed.Process.Serializable
1718
1819import Data.Binary (Binary)
1920
20−#if MIN_VERSION_base(4,7,0)
21+#if MIN_VERSION_base(4,10,0)
22+import Data.Typeable (Typeable)
23+import Type.Reflection (typeRep)
24+import Type.Reflection.Unsafe (TypeRep, typeRepFingerprint)
25+#elif MIN_VERSION_base(4,7,0)
2126import Data.Typeable (Typeable)
2227import Data.Typeable.Internal (TypeRep(TypeRep), typeOf)
2328#else
@@ -70,8 +75,10 @@ sizeOfFingerprint :: Int
7075sizeOfFingerprint = sizeOf (undefined :: Fingerprint)
7176
7277-- | The fingerprint of the typeRep of the argument
73−fingerprint :: Typeable a => a -> Fingerprint
74−#if MIN_VERSION_base(4,8,0)
78+fingerprint :: forall a. Typeable a => a -> Fingerprint
79+#if MIN_VERSION_base(4,10,0)
80+fingerprint _ = typeRepFingerprint (typeRep :: TypeRep a)
81+#elif MIN_VERSION_base(4,8,0)
7582fingerprint a = let TypeRep fp _ _ _ = typeOf a in fp
7683#else
7784fingerprint a = let TypeRep fp _ _ = typeOf a in fp