git.iko.soy/distributed-process
on 38745de help sign in
src/Control/Distributed/Process/Serializable.hs+2−13
since splitsnapshots
unifiedsplit
@@ -2,7 +2,6 @@
2{-# LANGUAGE UndecidableInstances #-}
2{-# LANGUAGE UndecidableInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE GADTs #-}
4{-# LANGUAGE GADTs #-}
5−{-# LANGUAGE CPP #-}
6module Control.Distributed.Process.Serializable
5module Control.Distributed.Process.Serializable
7 ( Serializable
6 ( Serializable
8 , encodeFingerprint
7 , encodeFingerprint
@@ -17,13 +16,7 @@ module Control.Distributed.Process.Serializable
17
16
18import Data.Binary (Binary)
17import Data.Binary (Binary)
19
18
20−#if MIN_VERSION_base(4,7,0)
21−import Data.Typeable (Typeable)
19+import Data.Typeable (Typeable, typeRepFingerprint, typeOf)
22−import Data.Typeable.Internal (TypeRep(TypeRep), typeOf)
23−#else
24−import Data.Typeable (Typeable(..))
25−import Data.Typeable.Internal (TypeRep(TypeRep))
26−#endif
27
20
28import Numeric (showHex)
21import Numeric (showHex)
29import Control.Exception (throw)
22import Control.Exception (throw)
@@ -71,11 +64,7 @@ sizeOfFingerprint = sizeOf (undefined :: Fingerprint)
71
64
72-- | The fingerprint of the typeRep of the argument
65-- | The fingerprint of the typeRep of the argument
73fingerprint :: Typeable a => a -> Fingerprint
66fingerprint :: Typeable a => a -> Fingerprint
74−#if MIN_VERSION_base(4,8,0)
67+fingerprint = typeRepFingerprint . typeOf
75−fingerprint a = let TypeRep fp _ _ _ = typeOf a in fp
76−#else
77−fingerprint a = let TypeRep fp _ _ = typeOf a in fp
78−#endif
79
68
80-- | Show fingerprint (for debugging purposes)
69-- | Show fingerprint (for debugging purposes)
81showFingerprint :: Fingerprint -> ShowS
70showFingerprint :: Fingerprint -> ShowS