summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathanclark <>2017-05-11 17:10:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-05-11 17:10:00 (GMT)
commitd5c7f8377d877f3c457301986ecc568a69790d39 (patch)
tree4516ecdf1324a7d9d45c6fd9363fcbf1dabbf973
parent3d582ec707ef89e00f57d97b437e458e525afb02 (diff)
version 0.0.1HEAD0.0.1master
-rw-r--r--HSet.cabal2
-rw-r--r--src/Data/HSet/Mutable.hs11
-rw-r--r--src/Data/HSet/Types.hs3
3 files changed, 7 insertions, 9 deletions
diff --git a/HSet.cabal b/HSet.cabal
index 8250834..0dc1d29 100644
--- a/HSet.cabal
+++ b/HSet.cabal
@@ -1,5 +1,5 @@
Name: HSet
-Version: 0.0.0
+Version: 0.0.1
Author: Athan Clark <athan.clark@gmail.com>
Maintainer: Athan Clark <athan.clark@gmail.com>
License: BSD3
diff --git a/src/Data/HSet/Mutable.hs b/src/Data/HSet/Mutable.hs
index b3bf3e9..f80320d 100644
--- a/src/Data/HSet/Mutable.hs
+++ b/src/Data/HSet/Mutable.hs
@@ -12,7 +12,8 @@ import Data.HSet.Types
import Prelude hiding (lookup, length)
import Data.Maybe (fromMaybe)
-import Data.Typeable.Internal (Fingerprint, TypeRep (TypeRep))
+import Data.Typeable (typeOf, typeRepFingerprint)
+import GHC.Fingerprint
import Data.Dynamic
import Data.HashTable.ST.Basic (HashTable)
@@ -31,10 +32,9 @@ new :: ST s (HSet s)
new = HSet <$> HT.new <*> HT.new
-insert :: ( Typeable a
- ) => a -> HSet s -> ST s (HKey a)
+insert :: Typeable a => a -> HSet s -> ST s (HKey a)
insert x (HSet xs count) = do
- let (TypeRep f _ _ _) = typeOf x
+ let f = typeRepFingerprint $ typeOf x
c <- fromMaybe 0 <$> HT.lookup count f
HT.insert count f (c+1)
let k = HKey' f c
@@ -42,8 +42,7 @@ insert x (HSet xs count) = do
pure (HKey k)
-lookup :: ( Typeable a
- ) => HKey a -> HSet s -> ST s (Maybe a)
+lookup :: Typeable a => HKey a -> HSet s -> ST s (Maybe a)
lookup (HKey k) (HSet xs _) = (>>= fromDynamic) <$> HT.lookup xs k
diff --git a/src/Data/HSet/Types.hs b/src/Data/HSet/Types.hs
index dea5eaa..9cbe4b6 100644
--- a/src/Data/HSet/Types.hs
+++ b/src/Data/HSet/Types.hs
@@ -4,8 +4,7 @@
module Data.HSet.Types where
-import Data.Typeable.Internal (Fingerprint (..))
-
+import GHC.Fingerprint (Fingerprint(..))
import GHC.Generics
import Data.Hashable