Skip to content

Commit fb57da3

Browse files
Drop conditional compilation in Control.Distributed.Process.Serializable.
1 parent eba4a42 commit fb57da3

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/Control/Distributed/Process/Serializable.hs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{-# LANGUAGE FlexibleInstances #-}
44
{-# LANGUAGE ScopedTypeVariables #-}
55
{-# LANGUAGE GADTs #-}
6-
{-# LANGUAGE CPP #-}
76
module Control.Distributed.Process.Serializable
87
( Serializable
98
, encodeFingerprint
@@ -18,17 +17,7 @@ module Control.Distributed.Process.Serializable
1817

1918
import Data.Binary (Binary)
2019

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)
26-
import Data.Typeable (Typeable)
27-
import Data.Typeable.Internal (TypeRep(TypeRep), typeOf)
28-
#else
29-
import Data.Typeable (Typeable(..))
30-
import Data.Typeable.Internal (TypeRep(TypeRep))
31-
#endif
20+
import Data.Typeable (Typeable, typeRepFingerprint, typeOf)
3221

3322
import Numeric (showHex)
3423
import Control.Exception (throw)
@@ -75,14 +64,8 @@ sizeOfFingerprint :: Int
7564
sizeOfFingerprint = sizeOf (undefined :: Fingerprint)
7665

7766
-- | The fingerprint of the typeRep of the argument
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)
82-
fingerprint a = let TypeRep fp _ _ _ = typeOf a in fp
83-
#else
84-
fingerprint a = let TypeRep fp _ _ = typeOf a in fp
85-
#endif
67+
fingerprint :: Typeable a => a -> Fingerprint
68+
fingerprint = typeRepFingerprint . typeOf
8669

8770
-- | Show fingerprint (for debugging purposes)
8871
showFingerprint :: Fingerprint -> ShowS

0 commit comments

Comments
 (0)