From 41fc8fd43955091bf3832e2d0d21e6114e612b43 Mon Sep 17 00:00:00 2001 From: meooow25 Date: Wed, 12 Aug 2026 00:42:55 +0200 Subject: [PATCH] Prepare v0.8.1 Bump version, set the since annotations and update the changelog. --- containers/changelog.md | 157 +++++++++++++++++- containers/containers.cabal | 2 +- containers/src/Data/IntMap/Internal.hs | 14 +- containers/src/Data/IntMap/Strict/Internal.hs | 10 +- containers/src/Data/IntSet/Internal.hs | 8 +- containers/src/Data/Map/Internal.hs | 12 +- containers/src/Data/Map/Strict/Internal.hs | 10 +- containers/src/Data/Sequence/Internal.hs | 10 +- containers/src/Data/Set/Internal.hs | 44 ++--- containers/src/Data/Set/Merge.hs | 4 +- 10 files changed, 211 insertions(+), 60 deletions(-) diff --git a/containers/changelog.md b/containers/changelog.md index b931de538..682022517 100644 --- a/containers/changelog.md +++ b/containers/changelog.md @@ -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 diff --git a/containers/containers.cabal b/containers/containers.cabal index 6a52c8bbd..40f1de159 100644 --- a/containers/containers.cabal +++ b/containers/containers.cabal @@ -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 diff --git a/containers/src/Data/IntMap/Internal.hs b/containers/src/Data/IntMap/Internal.hs index 5f6e6256c..4a8bafde9 100644 --- a/containers/src/Data/IntMap/Internal.hs +++ b/containers/src/Data/IntMap/Internal.hs @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/containers/src/Data/IntMap/Strict/Internal.hs b/containers/src/Data/IntMap/Strict/Internal.hs index fcb2e05be..6788e2104 100644 --- a/containers/src/Data/IntMap/Strict/Internal.hs +++ b/containers/src/Data/IntMap/Strict/Internal.hs @@ -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 @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/containers/src/Data/IntSet/Internal.hs b/containers/src/Data/IntSet/Internal.hs index dc5db0f34..30b67bd5b 100644 --- a/containers/src/Data/IntSet/Internal.hs +++ b/containers/src/Data/IntSet/Internal.hs @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/containers/src/Data/Map/Internal.hs b/containers/src/Data/Map/Internal.hs index 80a542206..80c550f82 100644 --- a/containers/src/Data/Map/Internal.hs +++ b/containers/src/Data/Map/Internal.hs @@ -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) @@ -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 @@ -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 @@ -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) @@ -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 @@ -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 diff --git a/containers/src/Data/Map/Strict/Internal.hs b/containers/src/Data/Map/Strict/Internal.hs index 84e054e14..0fd24d870 100644 --- a/containers/src/Data/Map/Strict/Internal.hs +++ b/containers/src/Data/Map/Strict/Internal.hs @@ -675,7 +675,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 @@ -1385,7 +1385,7 @@ mapKeysWith c f m = -- __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 @@ -1539,7 +1539,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) @@ -1691,7 +1691,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 @@ -1715,7 +1715,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 diff --git a/containers/src/Data/Sequence/Internal.hs b/containers/src/Data/Sequence/Internal.hs index af724a4ca..d2d0f79d3 100644 --- a/containers/src/Data/Sequence/Internal.hs +++ b/containers/src/Data/Sequence/Internal.hs @@ -2380,7 +2380,7 @@ viewRTree (Deep s pr m (Four w x y z)) = -- | \(O(n)\). Convert to a list of elements. -- --- @since FIXME +-- @since 0.8.1 toList :: Seq a -> [a] toList = F.toList @@ -3486,7 +3486,7 @@ take i xs@(Seq t) -- If the sequence contains fewer than @i@ elements, the whole sequence -- is returned. -- --- @since FIXME +-- @since 0.8.1 takeR :: Int -> Seq a -> Seq a takeR i xs = drop (length xs - i) xs @@ -3657,7 +3657,7 @@ drop i xs@(Seq t) -- If the sequence contains fewer than @i@ elements, the empty sequence -- is returned. -- --- @since FIXME +-- @since 0.8.1 dropR :: Int -> Seq a -> Seq a dropR i xs = take (length xs - i) xs @@ -3834,7 +3834,7 @@ splitAt i xs@(Seq t) -- with the position being counted from the last (rightmost) element. -- @'splitAtR' i s = ('dropR' i s, 'takeR' i s)@. -- --- @since FIXME +-- @since 0.8.1 splitAtR :: Int -> Seq a -> (Seq a, Seq a) splitAtR i xs = splitAt (length xs - i) xs @@ -4235,7 +4235,7 @@ filter p = foldl' (\ xs x -> if p x then xs `snoc'` x else xs) empty -- | \( O(n) \). Map elements and collect the 'Just' results. -- --- @since FIXME +-- @since 0.8.1 mapMaybe :: (a -> Maybe b) -> Seq a -> Seq b mapMaybe f = foldl' go empty where go xs x = case f x of diff --git a/containers/src/Data/Set/Internal.hs b/containers/src/Data/Set/Internal.hs index 529599065..a66d30bda 100644 --- a/containers/src/Data/Set/Internal.hs +++ b/containers/src/Data/Set/Internal.hs @@ -581,7 +581,7 @@ delete = go -- pop 2 (fromList [0,2,4]) == Just (fromList [0,4]) -- @ -- --- @since FIXME +-- @since 0.8.1 pop :: Ord a => a -> Set a -> Maybe (Set a) pop x0 t0 = case go x0 t0 of True :*: t -> Just t @@ -1025,7 +1025,7 @@ partition p0 t0 = toPair $ go p0 t0 -- If the function is monotonically non-decreasing, this function takes \(O(n)\) -- time. -- --- @since FIXME +-- @since 0.8.1 mapMaybe :: Ord b => (a -> Maybe b) -> Set a -> Set b mapMaybe f t = finishB (foldl' go emptyB t) where go b x = case f x of @@ -1795,7 +1795,7 @@ linkR_ x !lsz l r = case r of Tip -> Bin (1+lsz) x l Tip -- insertMin and insertMax don't perform potentially expensive comparisons. --- @since FIXME +-- @since 0.8.1 insertMax :: a -> Set a -> Set a insertMax x t = case t of @@ -1803,7 +1803,7 @@ insertMax x t Bin _ y l r -> balanceR y l (insertMax x r) --- @since FIXME +-- @since 0.8.1 insertMin :: a -> Set a -> Set a insertMin x t = case t of @@ -1814,7 +1814,7 @@ insertMin x t {-------------------------------------------------------------------- [link2 l r]: merges two trees. --------------------------------------------------------------------} --- @since FIXME +-- @since 0.8.1 link2 :: Set a -> Set a -> Set a link2 Tip r = r link2 l Tip = l @@ -1841,7 +1841,7 @@ link2R_ !lsz l r = case r of [glue l r]: glues two trees together. Assumes that [l] and [r] are already balanced with respect to each other. --------------------------------------------------------------------} --- @since FIXME +-- @since 0.8.1 glue :: Set a -> Set a -> Set a glue Tip r = r glue l Tip = l @@ -1985,7 +1985,7 @@ ratio = 2 -- balanceL is called when left subtree might have been inserted to or when -- right subtree might have been deleted from. --- @since FIXME +-- @since 0.8.1 balanceL :: a -> Set a -> Set a -> Set a balanceL x l r = case (l, r) of (Bin ls _ _ _, Bin rs _ _ _) @@ -2016,7 +2016,7 @@ balanceL_ x l r = case r of -- balanceR is called when right subtree might have been inserted to or when -- left subtree might have been deleted from. --- @since FIXME +-- @since 0.8.1 balanceR :: a -> Set a -> Set a -> Set a balanceR x l r = case (l, r) of (Bin ls _ _ _, Bin rs _ _ _) @@ -2212,7 +2212,7 @@ disjointUnion as bs = link2 (mapMonotonic Left as) (mapMonotonic Right bs) -- A tactic of type @WhenMissing f a@ is an abstract representation of a -- function of type @a -> f Bool@. -- --- @since FIXME +-- @since 0.8.1 data WhenMissing f a = WhenMissing { missingSubtree :: Set a -> f (Set a) , missingElem :: a -> f Bool @@ -2224,13 +2224,13 @@ data WhenMissing f a = WhenMissing -- A tactic of type @SimpleWhenMissing a@ is an abstract representation -- of a function of type @a -> Bool@. -- --- @since FIXME +-- @since 0.8.1 type SimpleWhenMissing = WhenMissing Identity -- | Along with 'filterAMissing', witnesses the isomorphism between -- @WhenMissing f a@ and @a -> f Bool@. -- --- @since FIXME +-- @since 0.8.1 runWhenMissing :: WhenMissing f a -> a -> f Bool runWhenMissing = missingElem @@ -2240,7 +2240,7 @@ runWhenMissing = missingElem -- A tactic of type @WhenMatched f a@ is an abstract representation of a -- function of type @a -> f Bool@. -- --- @since FIXME +-- @since 0.8.1 newtype WhenMatched f a = WhenMatched { matchedElem :: a -> f Bool } -- | A tactic for dealing with elements present in both sets in 'merge'. @@ -2248,20 +2248,20 @@ newtype WhenMatched f a = WhenMatched { matchedElem :: a -> f Bool } -- A tactic of type @SimpleWhenMatched a@ is an abstract representation of a -- function of type @a -> Bool@. -- --- @since FIXME +-- @since 0.8.1 type SimpleWhenMatched = WhenMatched Identity -- | Along with 'filterAMatched', witnesses the isomorphism between -- @WhenMatched f a@ and @a -> f Bool@. -- --- @since FIXME +-- @since 0.8.1 runWhenMatched :: WhenMatched f a -> a -> f Bool runWhenMatched = matchedElem -- | When an element is found in both sets, choose whether to keep the element -- in the merged set. -- --- @since FIXME +-- @since 0.8.1 filterMatched :: Applicative f => (a -> Bool) -> WhenMatched f a filterMatched f = WhenMatched (pure . f) {-# INLINE filterMatched #-} @@ -2269,7 +2269,7 @@ filterMatched f = WhenMatched (pure . f) -- | When an element is found in both sets, choose whether to keep the element -- in the merged set. -- --- @since FIXME +-- @since 0.8.1 filterAMatched :: (a -> f Bool) -> WhenMatched f a filterAMatched = WhenMatched @@ -2283,7 +2283,7 @@ filterAMatched = WhenMatched -- -- but @dropMissing@ is more efficient. -- --- @since FIXME +-- @since 0.8.1 dropMissing :: Applicative f => WhenMissing f a dropMissing = WhenMissing { missingSubtree = \_ -> pure Tip @@ -2301,7 +2301,7 @@ dropMissing = WhenMissing -- -- but @preserveMissing@ is more efficient. -- --- @since FIXME +-- @since 0.8.1 preserveMissing :: Applicative f => WhenMissing f a preserveMissing = WhenMissing { missingSubtree = pure @@ -2315,7 +2315,7 @@ preserveMissing = WhenMissing -- filterMissing :: (a -> Bool) -> 'SimpleWhenMissing' a -- @ -- --- @since FIXME +-- @since 0.8.1 filterMissing :: Applicative f => (a -> Bool) -> WhenMissing f a filterMissing f = WhenMissing { missingSubtree = pure . filter f @@ -2326,7 +2326,7 @@ filterMissing f = WhenMissing -- | Filter the elements that are missing from the other set using some -- 'Applicative' action. -- --- @since FIXME +-- @since 0.8.1 filterAMissing :: Applicative f => (a -> f Bool) -> WhenMissing f a filterAMissing f = WhenMissing { missingSubtree = filterA f @@ -2378,7 +2378,7 @@ filterAMissing f = WhenMissing -- site. To prevent excessive inlining, you should typically use 'merge' -- to define your custom combining functions. -- --- @since FIXME +-- @since 0.8.1 merge :: Ord a => SimpleWhenMissing a -- ^ What to do with elements in @s1@ but not @s2@ @@ -2430,7 +2430,7 @@ merge g1 g2 f = \s1 s2 -> runIdentity (mergeA g1 g2 f s1 s2) -- site. To prevent excessive inlining, you should generally only use -- 'mergeA' to define custom combining functions. -- --- @since FIXME +-- @since 0.8.1 mergeA :: (Applicative f, Ord a) => WhenMissing f a -- ^ What to do with elements in @s1@ but not @s2@ diff --git a/containers/src/Data/Set/Merge.hs b/containers/src/Data/Set/Merge.hs index 513f047f0..8a0324643 100644 --- a/containers/src/Data/Set/Merge.hs +++ b/containers/src/Data/Set/Merge.hs @@ -3,11 +3,11 @@ {-# LANGUAGE Safe #-} #endif --- This module defines an API for writing functions that merge two sets. The key +-- | This module defines an API for writing functions that merge two sets. The key -- functions are 'merge' and 'mergeA'. Each of these can be used with several -- different \"merge tactics\". -- --- @since FIXME +-- @since 0.8.1 module Data.Set.Merge ( -- ** Simple merge tactic types