Skip to content

Commit eba4a42

Browse files
Merge pull request haskell-distributed#314 from bgamari/master
Allow binary 0.9 and GHC 8.2
2 parents eca7a01 + 368e681 commit eba4a42

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

distributed-process.cabal

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ flag old-locale
4242

4343
Library
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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE DeriveDataTypeable #-}
22
{-# LANGUAGE UndecidableInstances #-}
33
{-# LANGUAGE FlexibleInstances #-}
4+
{-# LANGUAGE ScopedTypeVariables #-}
45
{-# LANGUAGE GADTs #-}
56
{-# LANGUAGE CPP #-}
67
module Control.Distributed.Process.Serializable
@@ -17,7 +18,11 @@ module Control.Distributed.Process.Serializable
1718

1819
import 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)
2126
import Data.Typeable (Typeable)
2227
import Data.Typeable.Internal (TypeRep(TypeRep), typeOf)
2328
#else
@@ -70,8 +75,10 @@ sizeOfFingerprint :: Int
7075
sizeOfFingerprint = 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)
7582
fingerprint a = let TypeRep fp _ _ _ = typeOf a in fp
7683
#else
7784
fingerprint a = let TypeRep fp _ _ = typeOf a in fp

0 commit comments

Comments
 (0)