HSet 0.0.0 → 0.0.1
raw patch · 3 files changed
+7/−9 lines, 3 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.HSet.Mutable: insert :: (Typeable a) => a -> HSet s -> ST s (HKey a)
+ Data.HSet.Mutable: insert :: Typeable a => a -> HSet s -> ST s (HKey a)
- Data.HSet.Mutable: lookup :: (Typeable a) => HKey a -> HSet s -> ST s (Maybe a)
+ Data.HSet.Mutable: lookup :: Typeable a => HKey a -> HSet s -> ST s (Maybe a)
Files
- HSet.cabal +1/−1
- src/Data/HSet/Mutable.hs +5/−6
- src/Data/HSet/Types.hs +1/−2
HSet.cabal view
@@ -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
src/Data/HSet/Mutable.hs view
@@ -12,7 +12,8 @@ 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 = 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 @@ 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
src/Data/HSet/Types.hs view
@@ -4,8 +4,7 @@ module Data.HSet.Types where -import Data.Typeable.Internal (Fingerprint (..))-+import GHC.Fingerprint (Fingerprint(..)) import GHC.Generics import Data.Hashable