Skip to content

Commit 3411516

Browse files
authored
Prepare release 0.2.11.0 (#266)
This adds and fixes some since annotations.
1 parent 0e241cc commit 3411516

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

CHANGES.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
1-
## next
1+
## 0.2.11.0
2+
3+
* Add `HashMap.findWithDefault` (soft-deprecates `HashMap.lookupDefault`).
4+
5+
* Add `HashMap.fromListWithKey`
26

3-
* Add `HashMap.findWithDefault` (deprecates `HashMap.lookupDefault`)
4-
57
* Add more folding functions and use them in `Foldable` instances.
68

79
* Add `HashMap.!?`, a flipped version of `lookup`.
810

11+
* Add `instance Bifoldable HashMap`.
12+
13+
### Bug fixes
14+
15+
* Fix a space leak affecting updates on keys with hash collisions.
16+
17+
* Improvements for `two`: strictness in key arguments, better sharing,
18+
clean up.
19+
20+
### Other changes
21+
22+
* Add call stack to `HashMap.!`.
23+
24+
* Speed up the `Hashable` instances for `HashMap` and `HashSet`.
25+
26+
* Various documentation improvements and fixes.
27+
928
## 0.2.10.0
1029

1130
* Add `HashMap.alterF`.

Data/HashMap/Base.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ instance Foldable.Foldable (HashMap k) where
227227
#endif
228228

229229
#if MIN_VERSION_base(4,10,0)
230-
-- | @since UNRELEASED
230+
-- | @since 0.2.11
231231
instance Bifoldable HashMap where
232232
bifoldMap f g = foldMapWithKey (\ k v -> f k `mappend` g v)
233233
{-# INLINE bifoldMap #-}
@@ -1251,7 +1251,7 @@ alter f k m =
12511251
-- Note: 'alterF' is a flipped version of the 'at' combinator from
12521252
-- <https://hackage.haskell.org/package/lens-4.15.4/docs/Control-Lens-At.html#v:at Control.Lens.At>.
12531253
--
1254-
-- @since 0.2.9
1254+
-- @since 0.2.10
12551255
alterF :: (Functor f, Eq k, Hashable k)
12561256
=> (Maybe v -> f (Maybe v)) -> k -> HashMap k v -> f (HashMap k v)
12571257
-- We only calculate the hash once, but unless this is rewritten
@@ -1945,6 +1945,8 @@ fromListWith f = L.foldl' (\ m (k, v) -> unsafeInsertWith f k v m) empty
19451945
--
19461946
-- > fromListWith f [(k, a), (k, b), (k, c), (k, d)]
19471947
-- > = fromList [(k, f k d (f k c (f k b a)))]
1948+
--
1949+
-- @since 0.2.11
19481950
fromListWithKey :: (Eq k, Hashable k) => (k -> v -> v -> v) -> [(k, v)] -> HashMap k v
19491951
fromListWithKey f = L.foldl' (\ m (k, v) -> unsafeInsertWithKey f k v m) empty
19501952
{-# INLINE fromListWithKey #-}

Data/HashMap/Strict/Base.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ alter f k m =
282282
-- Note: 'alterF' is a flipped version of the 'at' combinator from
283283
-- <https://hackage.haskell.org/package/lens-4.15.4/docs/Control-Lens-At.html#v:at Control.Lens.At>.
284284
--
285-
-- @since 0.2.9
285+
-- @since 0.2.10
286286
alterF :: (Functor f, Eq k, Hashable k)
287287
=> (Maybe v -> f (Maybe v)) -> k -> HashMap k v -> f (HashMap k v)
288288
-- Special care is taken to only calculate the hash once. When we rewrite
@@ -670,6 +670,8 @@ fromListWith f = L.foldl' (\ m (k, v) -> unsafeInsertWith f k v m) empty
670670
--
671671
-- > fromListWith f [(k, a), (k, b), (k, c), (k, d)]
672672
-- > = fromList [(k, f k d (f k c (f k b a)))]
673+
--
674+
-- @since 0.2.11
673675
fromListWithKey :: (Eq k, Hashable k) => (k -> v -> v -> v) -> [(k, v)] -> HashMap k v
674676
fromListWithKey f = L.foldl' (\ m (k, v) -> unsafeInsertWithKey f k v m) empty
675677
{-# INLINE fromListWithKey #-}

unordered-containers.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: unordered-containers
2-
version: 0.2.10.0
2+
version: 0.2.11.0
33
synopsis: Efficient hashing-based container types
44
description:
55
Efficient hashing-based container types. The containers have been

0 commit comments

Comments
 (0)