packages feed

stm-containers 0.2.4 → 0.2.5

raw patch · 5 files changed

+30/−15 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- STMContainers.Map: instance Eq k => Element (Association k v)
+ STMContainers.Bimap: instance Typeable Bimap
+ STMContainers.Bimap: type Key k = Key k
+ STMContainers.Map: instance Eq k => Element (k, v)
+ STMContainers.Map: instance Typeable Map
+ STMContainers.Multimap: instance Typeable Multimap
+ STMContainers.Multimap: type Key k = Key k
+ STMContainers.Multimap: type Value v = Element v
+ STMContainers.Set: instance Typeable Set
- STMContainers.Multimap: type Association k v = (Eq k, Hashable k, Eq v, Hashable v)
+ STMContainers.Multimap: type Association k v = (Key k, Value v)

Files

library/STMContainers/Bimap.hs view
@@ -2,6 +2,7 @@ (   Bimap,   Association,+  Key,   new,   newIO,   insert1,@@ -30,10 +31,15 @@ -- of the right-hand type and vice versa. data Bimap a b =    Bimap {m1 :: !(Map.Map a b), m2 :: !(Map.Map b a)}+  deriving (Typeable)  -- |--- A standard constraint for associations.-type Association a b = (Map.Key a, Map.Key b)+-- A constraint for associations.+type Association a b = (Key a, Key b)++-- |+-- A constraint for keys.+type Key k = Map.Key k  -- | -- Construct a new bimap.
library/STMContainers/Map.hs view
@@ -21,22 +21,19 @@  -- | -- A hash table, based on an STM-specialized hash array mapped trie.-newtype Map k v = Map (HAMT.HAMT (Association k v))+newtype Map k v = Map (HAMT.HAMT (k, v))+  deriving (Typeable)  -- |--- A standard constraint for keys.+-- A constraint for keys. type Key a = (Eq a, Hashable a) --- |--- A key-value association.-type Association k v = (k, v)--instance (Eq k) => HAMTNodes.Element (Association k v) where-  type ElementKey (Association k v) = k+instance (Eq k) => HAMTNodes.Element (k, v) where+  type ElementKey (k, v) = k   elementKey (k, v) = k  {-# INLINE associationValue #-}-associationValue :: Association k v -> v+associationValue :: (k, v) -> v associationValue (_, v) = v  -- |
library/STMContainers/Multimap.hs view
@@ -2,6 +2,8 @@ (   Multimap,   Association,+  Key,+  Value,   new,   newIO,   insert,@@ -25,10 +27,19 @@ --  -- Basically it's just a wrapper API around @'Map.Map' k ('Set.Set' v)@. newtype Multimap k v = Multimap (Map.Map k (Set.Set v))+  deriving (Typeable)  -- |--- A standard constraint for items.-type Association k v = (Eq k, Hashable k, Eq v, Hashable v)+-- A constraint for associations.+type Association k v = (Key k, Value v)++-- |+-- A constraint for keys.+type Key k = Map.Key k++-- |+-- A constraint for values.+type Value v = Set.Element v  -- | -- Look up an item by a value and a key.
library/STMContainers/Set.hs view
@@ -22,9 +22,10 @@ -- | -- A hash set, based on an STM-specialized hash array mapped trie. newtype Set e = Set {hamt :: HAMT.HAMT (HAMTElement e)}+  deriving (Typeable)  -- |--- A standard constraint for elements.+-- A constraint for elements. type Element a = (Eq a, Hashable a)  newtype HAMTElement e = HAMTElement e
stm-containers.cabal view
@@ -1,7 +1,7 @@ name:   stm-containers version:-  0.2.4+  0.2.5 synopsis:   Containers for STM description: