Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 154 additions & 3 deletions containers/changelog.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,179 @@
# Changelog for [`containers` package](http://github.com/haskell/containers)

## Next release
## 0.8.1 *August 2026*

### Additions

* Add `compareSize` for `IntSet` and `IntMap`. (Soumik Sarkar)
([#1135](https://github.com/haskell/containers/pull/1135))
([#1135](https://github.com/haskell/containers/pull/1135),
[#1139](https://github.com/haskell/containers/pull/1139))

* Add `mapMaybe` for `Seq`, `Set` and `IntSet`. (Phil Hazelden)
([#1159](https://github.com/haskell/containers/pull/1159))

* Add `fromSetA` for `Map` and `IntMap`. (L0neGamer)
([#1163](https://github.com/haskell/containers/pull/1163))
([#1163](https://github.com/haskell/containers/pull/1163),
[#1165](https://github.com/haskell/containers/pull/1165))

* Export `Tree` field selectors from `Data.Graph`. (Soumik Sarkar)
([#1144](https://github.com/haskell/containers/pull/1144))

* Add `upsert` for `Map` and `IntMap`. (Soumik Sarkar)
([#1145](https://github.com/haskell/containers/pull/1145))

* Add `pop` for `Map`, `Set`, `IntMap`, `IntSet`. (Soumik Sarkar)
([#1152](https://github.com/haskell/containers/pull/1152))

* Add `Data.Set.Merge`, a merge API for `Set`s. (Soumik Sarkar)
([#1169](https://github.com/haskell/containers/pull/1169))

* Add `Data.Sequence.toList`. (Soumik Sarkar)
([#1192](https://github.com/haskell/containers/pull/1192))

* Add `fromDescList` for `IntSet` and `IntMap` (Soumik Sarkar)
([#1194](https://github.com/haskell/containers/pull/1194))

* Add `fromListUpsert` for `Map` and `IntMap` (Soumik Sarkar)
([#1190](https://github.com/haskell/containers/pull/1190))

* Add `fromAscListUpsert` and `fromDescListUpsert` for `Map` and `IntMap`.
(Soumik Sarkar)
([#1199](https://github.com/haskell/containers/pull/1199))

* Add `takeR`, `dropR` and `splitAtR` for `Seq`. (Phil Crissman)
(see [#159](https://github.com/haskell/containers/issues/159))
([#1222](https://github.com/haskell/containers/pull/1222))

* Add `mapAssocsMonotonic` for `Map`. (Soumik Sarkar)
([#1230](https://github.com/haskell/containers/pull/1230))

### Performance improvements

* Improve performance of `Data.IntMap.fromAscList` and
`Data.IntSet.fromAscList`. (Soumik Sarkar)
([#1123](https://github.com/haskell/containers/pull/1123))

* Improve performance of `Data.IntMap.fromList` and `Data.IntSet.fromList`.
(Soumik Sarkar)
([#1129](https://github.com/haskell/containers/pull/1129),
[#1137](https://github.com/haskell/containers/pull/1137))

* Improved performance for `Data.IntMap.restrictKeys` and
`Data.IntMap.withoutKeys`. (Soumik Sarkar)
([#1131](https://github.com/haskell/containers/pull/1131))

* Minor performance improvements for `IntMap` and `IntSet` by skipping some
unnecessary checks. (Soumik Sarkar)
([#1136](https://github.com/haskell/containers/pull/1136))

* Improve performance of folds over `IntMap` and `IntSet`. (Soumik Sarkar)
([#1149](https://github.com/haskell/containers/pull/1149))

* Improve performance of mapping for keys for `IntMap` and `IntSet`.
(Soumik Sarkar)
([#1148](https://github.com/haskell/containers/pull/1148))

* Improve performance of `graphFromEdges`. (Soumik Sarkar)
([#1151](https://github.com/haskell/containers/pull/1151))

* Improve performance of `Map`-`Map` and `Set`-`Set` operations.
(Soumik Sarkar)
([#1141](https://github.com/haskell/containers/pull/1141))

* Improve performance of `Set` intersection. (Soumik Sarkar)
([#1170](https://github.com/haskell/containers/pull/1170),
[#1172](https://github.com/haskell/containers/pull/1172))

* Improve performance of `nubOrdOn` and `nubIntOn`. (Soumik Sarkar)
([#1206](https://github.com/haskell/containers/pull/1206),
[#1228](https://github.com/haskell/containers/pull/1228),
[#1229](https://github.com/haskell/containers/pull/1229))

* Use a different strategy for `Data.Set.alterF`, improving performance in
typical scenarios. (Soumik Sarkar)
([#1215](https://github.com/haskell/containers/pull/1215),

* Reduce allocations when using `Data.Map.alterF`. (Soumik Sarkar)
([#1219](https://github.com/haskell/containers/pull/1219),

### Documentation

* Update contributing instructions. (Soumik Sarkar)
([#1125](https://github.com/haskell/containers/pull/1125),
[#1150](https://github.com/haskell/containers/pull/1150))

* Add and improve documentation (Jonathan Knowles, Soumik Sarkar, Tom Smeding,
Alexey Kuleshevich, RikuMinamiyama, Steve Shuck)
([#1127](https://github.com/haskell/containers/pull/1127),
[#1138](https://github.com/haskell/containers/pull/1138),
[#1140](https://github.com/haskell/containers/pull/1140),
[#1143](https://github.com/haskell/containers/pull/1143),
[#1158](https://github.com/haskell/containers/pull/1158),
[#1164](https://github.com/haskell/containers/pull/1164),
[#1161](https://github.com/haskell/containers/pull/1161),
[#1168](https://github.com/haskell/containers/pull/1168),
[#1179](https://github.com/haskell/containers/pull/1179),
[#1189](https://github.com/haskell/containers/pull/1189),
[#1204](https://github.com/haskell/containers/pull/1204),
[#1218](https://github.com/haskell/containers/pull/1218),
[#1216](https://github.com/haskell/containers/pull/1216),
[#1225](https://github.com/haskell/containers/pull/1225),
[#1231](https://github.com/haskell/containers/pull/1231))

### Miscellaneous/internal

* Fix bounds for `deepseq`. (Soumik Sarkar)
([#1119](https://github.com/haskell/containers/pull/1119))

* Remove redundant `mappend` definitions in preparation for
[CLC #328](https://github.com/haskell/core-libraries-committee/issues/328).
(Soumik Sarkar)
([#1142](https://github.com/haskell/containers/pull/1142))

* CI improvements. (Soumik Sarkar, Lennart Augustsson)
([#1147](https://github.com/haskell/containers/pull/1147),
[#1173](https://github.com/haskell/containers/pull/1173),
[#1177](https://github.com/haskell/containers/pull/1177),
[#1183](https://github.com/haskell/containers/pull/1183),
[#1180](https://github.com/haskell/containers/pull/1180),
[#1196](https://github.com/haskell/containers/pull/1196),
[#1207](https://github.com/haskell/containers/pull/1207),
[#1224](https://github.com/haskell/containers/pull/1224))

* Miscellaneous internal improvements. (Soumik Sarkar, Simon Hengel)
([#1126](https://github.com/haskell/containers/pull/1126),
[#1167](https://github.com/haskell/containers/pull/1167),
[#1175](https://github.com/haskell/containers/pull/1175),
[#1211](https://github.com/haskell/containers/pull/1211),
[#1210](https://github.com/haskell/containers/pull/1210),
[#1212](https://github.com/haskell/containers/pull/1212),
[#1213](https://github.com/haskell/containers/pull/1213),
[#1217](https://github.com/haskell/containers/pull/1217),
[#1223](https://github.com/haskell/containers/pull/1223))

* Additional exports from `Data.Set.Internal`. (Frank Staals)
([#1178](https://github.com/haskell/containers/pull/1178))

* Test improvements. (Soumik Sarkar)
([#1181](https://github.com/haskell/containers/pull/1181),
[#1188](https://github.com/haskell/containers/pull/1188),
[#1191](https://github.com/haskell/containers/pull/1191),
[#1198](https://github.com/haskell/containers/pull/1198),
[#1197](https://github.com/haskell/containers/pull/1197),
[#1203](https://github.com/haskell/containers/pull/1203))

* Use template-haskell-lift for GHC>=9.14 (Teo Camarasu)
([#1162](https://github.com/haskell/containers/pull/1162))

* Add some benchmarks. (Soumik Sarkar)
([#1182](https://github.com/haskell/containers/pull/1182))

* Drop redundant Applicative constraints. (Soumik Sarkar)
([#1193](https://github.com/haskell/containers/pull/1193))

* Drop symlinks to make development easier on Windows. (AndreasPK)
([#886](https://github.com/haskell/containers/pull/886))

## 0.8 *March 2025*

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion containers/containers.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: containers
version: 0.8
version: 0.8.1
license: BSD-3-Clause
license-file: LICENSE
maintainer: libraries@haskell.org
Expand Down
14 changes: 7 additions & 7 deletions containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ size = go 0
-- @compareSize m c@ returns the same result as @compare ('size' m) c@ but is
-- more efficient when @c@ is smaller than the size of the map.
--
-- @since FIXME
-- @since 0.8.1
compareSize :: IntMap a -> Int -> Ordering
compareSize Nil c0 = compare 0 c0
compareSize _ c0 | c0 <= 0 = GT
Expand Down Expand Up @@ -983,7 +983,7 @@ delete _k Nil = Nil
-- pop 2 (fromList [(0,"a"),(2,"b"),(4,"c")]) == Just ("b",fromList [(0,"a"),(4,"c")])
-- @
--
-- @since FIXME
-- @since 0.8.1
pop :: Key -> IntMap a -> Maybe (a, IntMap a)
pop k0 t0 = case go k0 t0 of
Popped (Just y) t -> Just (y, t)
Expand Down Expand Up @@ -1081,7 +1081,7 @@ updateWithKey _ _ Nil = Nil
-- upsert inc 200 (fromList [(100,1),(300,2)]) == fromList [(100,1),(200,1),(300,2)]
-- @
--
-- @since FIXME
-- @since 0.8.1
upsert :: (Maybe a -> a) -> Key -> IntMap a -> IntMap a
upsert f !k t@(Bin p l r)
| nomatch k p = linkKey k (Tip k (f Nothing)) p t
Expand Down Expand Up @@ -3554,7 +3554,7 @@ fromListWithKey f xs =
-- > let f x = maybe [x] (x:)
-- > fromListUpsert f [(5,'a'), (5,'b'), (3,'c'), (3,'d'), (5,'e')] == fromList [(3,"dc"), (5,"eba")]
--
-- @since FIXME
-- @since 0.8.1
fromListUpsert :: (a -> Maybe b -> b) -> [(Key, a)] -> IntMap b
fromListUpsert f xs =
finishB (Foldable.foldl' (\b (kx, x) -> upsertB (f x) kx b) emptyB xs)
Expand Down Expand Up @@ -3629,7 +3629,7 @@ fromAscListWithKey f xs = ascLinkAll (Foldable.foldl' next MSNada xs)
-- > let f x = maybe [x] (x:)
-- > fromAscListUpsert f [(3,'a'), (3,'b'), (5,'c'), (5,'d'), (5,'e')] == fromList [(3,"ba"), (5,"edc")]
--
-- @since FIXME
-- @since 0.8.1
fromAscListUpsert :: (a -> Maybe b -> b) -> [(Key, a)] -> IntMap b
fromAscListUpsert f xs = ascLinkAll (Foldable.foldl' next MSNada xs)
where
Expand Down Expand Up @@ -3670,7 +3670,7 @@ fromDistinctAscList = fromAscList
-- > fromDescList [(5,"a"), (3,"b")] == fromList [(3,"b"), (5,"a")]
-- > fromDescList [(5,"a"), (5,"b"), (3,"b")] == fromList [(3,"b"), (5,"b")]
--
-- @since FIXME
-- @since 0.8.1
fromDescList :: [(Key,a)] -> IntMap a
fromDescList xs =
descLinkAll (Foldable.foldl' (\s (ky, y) -> descInsert ky y s) MSNada xs)
Expand All @@ -3686,7 +3686,7 @@ fromDescList xs =
-- > let f x = maybe [x] (x:)
-- > fromDescListUpsert f [(5,'a'), (5,'b'), (5,'c'), (3,'d'), (3,'e')] == fromList [(3,"ed"), (5,"cba")]
--
-- @since FIXME
-- @since 0.8.1
fromDescListUpsert :: (a -> Maybe b -> b) -> [(Key, a)] -> IntMap b
fromDescListUpsert f xs = descLinkAll (Foldable.foldl' next MSNada xs)
where
Expand Down
10 changes: 5 additions & 5 deletions containers/src/Data/IntMap/Strict/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ updateWithKey f !k t =
-- upsert inc 200 (fromList [(100,1),(300,2)]) == fromList [(100,1),(200,1),(300,2)]
-- @
--
-- @since FIXME
-- @since 0.8.1
upsert :: (Maybe a -> a) -> Key -> IntMap a -> IntMap a
upsert f !k t@(Bin p l r)
| nomatch k p = linkKey k (Tip k $! f Nothing) p t
Expand Down Expand Up @@ -1223,7 +1223,7 @@ fromListWithKey f xs =
-- > let f x = maybe [x] (x:)
-- > fromListUpsert f [(5,'a'), (5,'b'), (3,'c'), (3,'d'), (5,'e')] == fromList [(3,"dc"), (5,"eba")]
--
-- @since FIXME
-- @since 0.8.1
fromListUpsert :: (a -> Maybe b -> b) -> [(Key, a)] -> IntMap b
fromListUpsert f xs =
finishB (Foldable.foldl' (\b (kx, x) -> upsertB (f x) kx b) emptyB xs)
Expand Down Expand Up @@ -1298,7 +1298,7 @@ fromAscListWithKey f xs = ascLinkAll (Foldable.foldl' next MSNada xs)
-- > let f x = maybe [x] (x:)
-- > fromAscListUpsert f [(3,'a'), (3,'b'), (5,'c'), (5,'d'), (5,'e')] == fromList [(3,"ba"), (5,"edc")]
--
-- @since FIXME
-- @since 0.8.1
fromAscListUpsert :: (a -> Maybe b -> b) -> [(Key, a)] -> IntMap b
fromAscListUpsert f xs = ascLinkAll (Foldable.foldl' next MSNada xs)
where
Expand Down Expand Up @@ -1336,7 +1336,7 @@ fromDistinctAscList = fromAscList
-- > fromDescList [(5,"a"), (3,"b")] == fromList [(3,"b"), (5,"a")]
-- > fromDescList [(5,"a"), (5,"b"), (3,"b")] == fromList [(3,"b"), (5,"b")]
--
-- @since FIXME
-- @since 0.8.1
fromDescList :: [(Key,a)] -> IntMap a
fromDescList xs =
descLinkAll (Foldable.foldl' (\s (!ky, !y) -> descInsert ky y s) MSNada xs)
Expand All @@ -1352,7 +1352,7 @@ fromDescList xs =
-- > let f x = maybe [x] (x:)
-- > fromDescListUpsert f [(5,'a'), (5,'b'), (5,'c'), (3,'d'), (3,'e')] == fromList [(3,"ed"), (5,"cba")]
--
-- @since FIXME
-- @since 0.8.1
fromDescListUpsert :: (a -> Maybe b -> b) -> [(Key, a)] -> IntMap b
fromDescListUpsert f xs = descLinkAll (Foldable.foldl' next MSNada xs)
where
Expand Down
8 changes: 4 additions & 4 deletions containers/src/Data/IntSet/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ size = go 0
-- @compareSize m c@ returns the same result as @compare ('size' m) c@ but is
-- more efficient when @c@ is smaller than the size of the set.
--
-- @since FIXME
-- @since 0.8.1
compareSize :: IntSet -> Int -> Ordering
compareSize Nil c0 = compare 0 c0
compareSize _ c0 | c0 <= 0 = GT
Expand Down Expand Up @@ -573,7 +573,7 @@ deleteBM _ _ Nil = Nil
-- pop 2 (fromList [0,2,4]) == Just (fromList [0,4])
-- @
--
-- @since FIXME
-- @since 0.8.1
pop :: Key -> IntSet -> Maybe IntSet
pop x0 t0 = case go x0 t0 of
True :*: t -> Just t
Expand Down Expand Up @@ -930,7 +930,7 @@ filter predicate t
-- If the function is monotonically non-decreasing or monotonically
-- non-increasing, 'mapMaybe' takes \(O(n)\) time.
--
-- @since FIXME
-- @since 0.8.1
mapMaybe :: (Key -> Maybe Key) -> IntSet -> IntSet
mapMaybe f t = finishB (foldl' go emptyB t)
where go b x = case f x of
Expand Down Expand Up @@ -1542,7 +1542,7 @@ fromDistinctAscList = fromAscList
-- non-increasing order. This precondition is not checked. Use 'fromList' if the
-- precondition may not hold.
--
-- @since FIXME
-- @since 0.8.1

-- See Note [fromAscList implementation] in Data.IntMap.Internal.
fromDescList :: [Key] -> IntSet
Expand Down
12 changes: 6 additions & 6 deletions containers/src/Data/Map/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ delete = go
-- pop 2 (fromList [(0,"a"),(2,"b"),(4,"c")]) == Just ("b",fromList [(0,"a"),(4,"c")])
-- @
--
-- @since FIXME
-- @since 0.8.1
pop :: Ord k => k -> Map k a -> Maybe (a, Map k a)
pop k0 t0 = case go k0 t0 of
Popped (Just y) t -> Just (y, t)
Expand Down Expand Up @@ -1082,7 +1082,7 @@ updateWithKey = go
-- upsert inc \'b\' (fromList [(\'a\',1),(\'c\',2)]) == fromList [(\'a\',1),(\'b\',1),(\'c\',2)]
-- @
--
-- @since FIXME
-- @since 0.8.1
upsert :: Ord k => (Maybe a -> a) -> k -> Map k a -> Map k a
upsert f !k (Bin sz kx x l r) =
case compare k kx of
Expand Down Expand Up @@ -3165,7 +3165,7 @@ mapKeysMonotonic f = mapAssocsMonotonic (\k x -> (f k, x))
-- __Warning__: This function should be used only if @f@ is monotonically
-- strictly increasing in the key. This precondition is not checked.
--
-- @since FIXME
-- @since 0.8.1
mapAssocsMonotonic :: (k1 -> a1 -> (k2, a2)) -> Map k1 a1 -> Map k2 a2
mapAssocsMonotonic f = go
where
Expand Down Expand Up @@ -3491,7 +3491,7 @@ fromListWithKey f xs =
-- > let f x = maybe [x] (x:)
-- > fromListUpsert f [(5,'a'), (5,'b'), (3,'c'), (3,'d'), (5,'e')] == fromList [(3,"dc"), (5,"eba")]
--
-- @since FIXME
-- @since 0.8.1
fromListUpsert :: Ord k => (a -> Maybe b -> b) -> [(k, a)] -> Map k b
fromListUpsert f xs =
finishB (Foldable.foldl' (\b (kx, x) -> upsertB (f x) kx b) emptyB xs)
Expand Down Expand Up @@ -3697,7 +3697,7 @@ fromDescListWithKey f xs = descLinkAll (Foldable.foldl' next Nada xs)
-- > let f x = maybe [x] (x:)
-- > fromAscListUpsert f [(3,'a'), (3,'b'), (5,'c'), (5,'d'), (5,'e')] == fromList [(3,"ba"), (5,"edc")]
--
-- @since FIXME
-- @since 0.8.1
fromAscListUpsert :: Eq k => (a -> Maybe b -> b) -> [(k, a)] -> Map k b
fromAscListUpsert f xs = ascLinkAll (Foldable.foldl' next Nada xs)
where
Expand All @@ -3719,7 +3719,7 @@ fromAscListUpsert f xs = ascLinkAll (Foldable.foldl' next Nada xs)
-- > let f x = maybe [x] (x:)
-- > fromDescListUpsert f [(5,'a'), (5,'b'), (5,'c'), (3,'d'), (3,'e')] == fromList [(3,"ed"), (5,"cba")]
--
-- @since FIXME
-- @since 0.8.1
fromDescListUpsert :: Eq k => (a -> Maybe b -> b) -> [(k, a)] -> Map k b
fromDescListUpsert f xs = descLinkAll (Foldable.foldl' next Nada xs)
where
Expand Down
Loading
Loading