git.iko.soy/distributed-process
on master help sign in
Merge pull request #314 from bgamari/master
eba4a42Facundo Domínguez
distributed-process.cabal+6−6
@@ -42,7 +42,7 @@ flag old-locale
42
42
43Library
43Library
44 Build-Depends: base >= 4.6 && < 5,
44 Build-Depends: base >= 4.6 && < 5,
45− binary >= 0.6.3 && < 0.9,
45+ binary >= 0.6.3 && < 0.10,
46 hashable >= 1.2.0.5 && < 1.3,
46 hashable >= 1.2.0.5 && < 1.3,
47 network-transport >= 0.4.1.0 && < 0.6,
47 network-transport >= 0.4.1.0 && < 0.6,
48 stm >= 2.4 && < 2.5,
48 stm >= 2.4 && < 2.5,
@@ -123,7 +123,7 @@ benchmark distributed-process-throughput
123 distributed-process,
123 distributed-process,
124 network-transport-tcp >= 0.3 && < 0.7,
124 network-transport-tcp >= 0.3 && < 0.7,
125 bytestring >= 0.9 && < 0.11,
125 bytestring >= 0.9 && < 0.11,
126− binary >= 0.6.3 && < 0.9
126+ binary >= 0.6.3 && < 0.10
127 Main-Is: benchmarks/Throughput.hs
127 Main-Is: benchmarks/Throughput.hs
128 ghc-options: -Wall
128 ghc-options: -Wall
129
129
@@ -133,7 +133,7 @@ benchmark distributed-process-latency
133 distributed-process,
133 distributed-process,
134 network-transport-tcp >= 0.3 && < 0.7,
134 network-transport-tcp >= 0.3 && < 0.7,
135 bytestring >= 0.9 && < 0.11,
135 bytestring >= 0.9 && < 0.11,
136− binary >= 0.6.3 && < 0.9
136+ binary >= 0.6.3 && < 0.10
137 Main-Is: benchmarks/Latency.hs
137 Main-Is: benchmarks/Latency.hs
138 ghc-options: -Wall
138 ghc-options: -Wall
139
139
@@ -143,7 +143,7 @@ benchmark distributed-process-channels
143 distributed-process,
143 distributed-process,
144 network-transport-tcp >= 0.3 && < 0.7,
144 network-transport-tcp >= 0.3 && < 0.7,
145 bytestring >= 0.9 && < 0.11,
145 bytestring >= 0.9 && < 0.11,
146− binary >= 0.6.3 && < 0.9
146+ binary >= 0.6.3 && < 0.10
147 Main-Is: benchmarks/Channels.hs
147 Main-Is: benchmarks/Channels.hs
148 ghc-options: -Wall
148 ghc-options: -Wall
149
149
@@ -153,7 +153,7 @@ benchmark distributed-process-spawns
153 distributed-process,
153 distributed-process,
154 network-transport-tcp >= 0.3 && < 0.7,
154 network-transport-tcp >= 0.3 && < 0.7,
155 bytestring >= 0.9 && < 0.11,
155 bytestring >= 0.9 && < 0.11,
156− binary >= 0.6.3 && < 0.9
156+ binary >= 0.6.3 && < 0.10
157 Main-Is: benchmarks/Spawns.hs
157 Main-Is: benchmarks/Spawns.hs
158 ghc-options: -Wall
158 ghc-options: -Wall
159
159
@@ -163,6 +163,6 @@ benchmark distributed-process-ring
163 distributed-process,
163 distributed-process,
164 network-transport-tcp >= 0.3 && < 0.7,
164 network-transport-tcp >= 0.3 && < 0.7,
165 bytestring >= 0.9 && < 0.11,
165 bytestring >= 0.9 && < 0.11,
166− binary >= 0.6.3 && < 0.9
166+ binary >= 0.6.3 && < 0.10
167 Main-Is: benchmarks/ProcessRing.hs
167 Main-Is: benchmarks/ProcessRing.hs
168 ghc-options: -Wall -threaded -O2 -rtsopts
168 ghc-options: -Wall -threaded -O2 -rtsopts
src/Control/Distributed/Process/Serializable.hs+10−3
@@ -1,6 +1,7 @@
1{-# LANGUAGE DeriveDataTypeable #-}
1{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE UndecidableInstances #-}
2{-# LANGUAGE UndecidableInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4+{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE GADTs #-}
5{-# LANGUAGE GADTs #-}
5{-# LANGUAGE CPP #-}
6{-# LANGUAGE CPP #-}
6module Control.Distributed.Process.Serializable
7module Control.Distributed.Process.Serializable
@@ -17,7 +18,11 @@ module Control.Distributed.Process.Serializable
17
18
18import Data.Binary (Binary)
19import Data.Binary (Binary)
19
20
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)
21import Data.Typeable (Typeable)
26import Data.Typeable (Typeable)
22import Data.Typeable.Internal (TypeRep(TypeRep), typeOf)
27import Data.Typeable.Internal (TypeRep(TypeRep), typeOf)
23#else
28#else
@@ -70,8 +75,10 @@ sizeOfFingerprint :: Int
70sizeOfFingerprint = sizeOf (undefined :: Fingerprint)
75sizeOfFingerprint = sizeOf (undefined :: Fingerprint)
71
76
72-- | The fingerprint of the typeRep of the argument
77-- | The fingerprint of the typeRep of the argument
73−fingerprint :: Typeable a => a -> Fingerprint
78+fingerprint :: forall a. Typeable a => a -> Fingerprint
74−#if MIN_VERSION_base(4,8,0)
79+#if MIN_VERSION_base(4,10,0)
80+fingerprint _ = typeRepFingerprint (typeRep :: TypeRep a)
81+#elif MIN_VERSION_base(4,8,0)
75fingerprint a = let TypeRep fp _ _ _ = typeOf a in fp
82fingerprint a = let TypeRep fp _ _ _ = typeOf a in fp
76#else
83#else
77fingerprint a = let TypeRep fp _ _ = typeOf a in fp
84fingerprint a = let TypeRep fp _ _ = typeOf a in fp