packages feed

concurrent-hashtable 0.1.3 → 0.1.4

raw patch · 3 files changed

+19/−4 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

README.md view
@@ -5,3 +5,18 @@ ## Installation  > stack install++## Usage Example++```{haskell}+> ht <- newWithDefaults 4     -- creates hash table of initial size 4+> insert ht 1 "hello"         -- adds key-value pair (1,"hello")+> insert ht 2 "world"         -- adds key-value pair (2,"world")+> atomically $ readAssocs ht  -- convert to a key-value list+ [(1,"hello"),(2,"world")]+> readSizeIO ht               -- returns 4+> insert ht 3 "!"             -- adds key-value pair (3,"!") and triggers a resize as the load fraction is ≥ 0.75+> readSizeIO ht               -- returns 8+> atomically $ readAssocs ht  -- convert to a key-value list+ [(1,"hello"),(3,"!"),(2,"world")]+```
concurrent-hashtable.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: cd9377375669850e36b4505949d445efc12cf57a2c9bb8ea352987259c507369+-- hash: 858878d1ee73f77599b540ea13d5e57adb5229d7437a5c5c24c792dfa2ca2906  name:           concurrent-hashtable-version:        0.1.3+version:        0.1.4 synopsis:       Thread-safe hash tables for multi-cores! description:    Please see the README on GitHub at <https://github.com/pwrobinson/concurrent-hashtable#readme> category:       Concurrency
src/Data/HashTable.hs view
@@ -11,9 +11,9 @@ -- You can find benchmarks and more information about the internals of this package here:  <https://lowerbound.io/blog/2019-10-24_concurrent_hash_table_performance.html> -- ----- Example usage:+-- Usage Example: ----- >> ht <- newWithDefaults 2     -- creates hash table of initial size 4+-- >> ht <- newWithDefaults 4     -- creates hash table of initial size 4 -- >> insert ht 1 "hello"         -- adds key-value pair (1,"hello") -- >> insert ht 2 "world"         -- adds key-value pair (2,"world") -- >> atomically $ readAssocs ht  -- convert to a key-value list