From 4f42baf80ddf723967adc8fe3572e8c62774cde0 Mon Sep 17 00:00:00 2001 From: meooow25 Date: Wed, 26 Feb 2025 00:12:21 +0530 Subject: [PATCH 1/4] Prepare for 0.8 * Bump version to 0.8 * Update changelog and since annotations * Update cabal.project to allow CI to work --- cabal.project | 9 +- containers/changelog.md | 172 +++++++++++++++--- containers/containers.cabal | 2 +- containers/src/Data/Graph.hs | 4 +- containers/src/Data/IntMap/Internal.hs | 6 +- containers/src/Data/IntSet/Internal.hs | 14 +- .../Data/IntSet/Internal/IntTreeCommons.hs | 2 +- containers/src/Data/Map/Internal.hs | 8 +- containers/src/Data/Sequence/Internal.hs | 10 +- containers/src/Data/Set/Internal.hs | 8 +- containers/src/Data/Tree.hs | 12 +- 11 files changed, 185 insertions(+), 62 deletions(-) diff --git a/cabal.project b/cabal.project index 257339c63..bf470f013 100644 --- a/cabal.project +++ b/cabal.project @@ -1,9 +1,14 @@ packages: containers/ containers-tests/ +-- Tip: Remove containers from the above list when making changes locally. +-- This avoids recompiling some dependencies (that depend on containers) when +-- you test or benchmark your changes. tests: True benchmarks: True --- package containers-tests --- ghc-options: -Werror +-- Disregard bounds on containers for all packages. +-- This allows test dependencies to build (and hopefully work) on CI, even if +-- the latest containers version is not yet marked as supported in their bounds. +allow-newer: all:containers diff --git a/containers/changelog.md b/containers/changelog.md index bf6ae7315..f7839a72a 100644 --- a/containers/changelog.md +++ b/containers/changelog.md @@ -1,6 +1,6 @@ # Changelog for [`containers` package](http://github.com/haskell/containers) -## Next release +## 0.8 *March 2025* ### Breaking changes @@ -8,87 +8,203 @@ `Data.IntMap.Lazy.splitLookup`, `Data.IntMap.Strict.splitLookup` and `Data.IntSet.splitMember` are now strict in the key. Previously, the key was ignored for an empty map or set. (Soumik Sarkar) + ([#982](https://github.com/haskell/containers/pull/982), + [#983](https://github.com/haskell/containers/pull/983)) -* The following functions have been updated to match the strictness of their +* These functions have been updated to match the strictness of their `fromList` counterparts: - * `Data.Map.Strict.fromAscList` - * `Data.Map.Strict.fromAscListWith` - * `Data.Map.Strict.fromAscListWithKey` - * `Data.Map.Strict.fromDescList` - * `Data.Map.Strict.fromDescListWith` - * `Data.Map.Strict.fromDescListWithKey` - * `Data.IntMap.Strict.fromAscList` - * `Data.IntMap.Strict.fromAscListWith` - * `Data.IntMap.Strict.fromAscListWithKey` + * `Data.Map.Strict`: `fromAscList`, `fromAscListWith`, `fromAscListWithKey` + `fromDescList`, `fromDescListWith`, `fromDescListWithKey` + * `Data.IntMap.Strict`: `fromAscList`, `fromAscListWith`, `fromAscListWithKey` Previously they were lazier and did not force the first value in runs of at least 2 entries with equal keys. (Soumik Sarkar) - -* Various deprecated functions, whose definitions currently cause type errors, - have been removed. (Soumik Sarkar) + ([#1023](https://github.com/haskell/containers/pull/1023)) * `Data.Set.fold` and `Data.IntSet.fold` have long been documented as deprecated and are now marked as such. They will be removed in a future - release. + release. (Soumik Sarkar) + ([#1049](https://github.com/haskell/containers/pull/1049)) + +* For `Data.IntMap.{Lazy,Strict}`, `updateMin`, `updateMax`, `updateMinWithKey`, + `updateMaxWithKey` now return an empty map for an input empty map instead of + calling `error`. This matches the behavior of `Data.Map`. (Kushagra Gupta) + ([#1065](https://github.com/haskell/containers/pull/1065)) + +* `foldl'` and `foldr'` for `Seq` are now strict in the initial value. This + matches the behavior of the default implementations and of the other + structures in the library. (Soumik Sarkar) + ([#1077](https://github.com/haskell/containers/pull/1077)) + +* Various deprecated functions, whose definitions currently cause type errors, + have been removed. (Soumik Sarkar) + ([#1046](https://github.com/haskell/containers/pull/1046)) ### Bug fixes * Make the package compile with MicroHs. (Lennart Augustsson) + ([#1043](https://github.com/haskell/containers/pull/1043), + [#1081](https://github.com/haskell/containers/pull/1081)) + +* Fix a strictness bug in `Data.Map.Strict.fromDistinctAscList` and + `Data.Map.Strict.fromDistinctDescList` where all values were not forced. + This bug affects versions 0.6.8 and 0.7. (Neil Mayhew) + ([#996](https://github.com/haskell/containers/pull/996)) + +* Fix a bug in `Data.IntMap`'s `isProperSubmapOfBy` where it could incorrectly + return `False`. (Soumik Sarkar) + ([#1008](https://github.com/haskell/containers/pull/1008)) + +* Make `Data.Map.Merge.{Lazy,Strict}.filterAMissing` sequence effects in the + correct order. (j6carey) + ([#1005](https://github.com/haskell/containers/pull/1005)) * `Data.Map.Strict.mergeWithKey` now forces the result of the combining function to WHNF. (Soumik Sarkar) + ([#1024](https://github.com/haskell/containers/pull/1024)) * Fix an issue where `Data.Map.mergeWithKey`, `Data.Map.Strict.mergeWithKey`, `Data.IntMap.mergeWithKey`, `Data.IntMap.Strict.mergeWithKey` could call the provided `only2` function with empty maps, contrary to documentation. - (Soumik Sarkar) + (Soumik Sarkar) ([#1025](https://github.com/haskell/containers/pull/1025)) ### Additions +* Add `Data.Graph.flattenSCC1`. (Andreas Abel) + ([#987](https://github.com/haskell/containers/pull/987)) + +* Add `symmetricDifference` for `Set`, `Map`, `IntSet`, `IntMap`. + (Soumik Sarkar) ([#1009](https://github.com/haskell/containers/pull/1009)) + * Add `lookupMin` and `lookupMax` for `Data.IntSet`. (Soumik Sarkar) + ([#976](https://github.com/haskell/containers/pull/976)) * Add `Intersection` and `intersections` for `Data.Set` and `Data.IntSet`. (Reed Mullanix, Soumik Sarkar) + ([#756](https://github.com/haskell/containers/pull/756), + [#1040](https://github.com/haskell/containers/pull/1040), + [#1052](https://github.com/haskell/containers/pull/1052), + [#1080](https://github.com/haskell/containers/pull/1080)) * Add `foldMap` for `Data.IntSet`. (Soumik Sarkar) + ([#1048](https://github.com/haskell/containers/pull/1048)) + +* Add `filterKeys` for `Data.Map` and `Data.IntMap`. (flip111) + ([#972](https://github.com/haskell/containers/pull/972)) + +* `NFData1`, `NFData2` instances for `SCC`, `IntMap`, `Map`, `Sequence`, `Set`, + `Tree` and relevant internal dependencies (David Beacham) + ([#992](https://github.com/haskell/containers/pull/992)) * Add `leaves`, `edges`, `pathsToRoot`, `pathsFromRoot`, `PostOrder` to `Data.Tree`. (Soumik Sarkar) + ([#1109](https://github.com/haskell/containers/pull/1109)) ### Performance improvements +* The internal representations of `IntMap` and `IntSet` have been changed + to be a little more memory efficient. (Soumik Sarkar) + ([#995](https://github.com/haskell/containers/pull/995), + [#998](https://github.com/haskell/containers/pull/998)) + +* Improved performance for `Data.Map`'s `minViewSure` and `maxViewSure`. + (Soumik Sarkar) ([#1001](https://github.com/haskell/containers/pull/1001)) + * For `Data.Graph.SCC`, `Foldable.toList` and `Foldable1.toNonEmpty` now do not perform a copy. (Soumik Sarkar) + ([#1057](https://github.com/haskell/containers/pull/1057)) * Improved performance for `Data.Intset`'s `foldr`, `foldl'`, `foldl`, `foldr'`. + (Soumik Sarkar) ([#1079](https://github.com/haskell/containers/pull/1079)) * Improved performance for `Data.Set` and `Data.Map`'s `fromAscList*` and - `fromDescList*` functions. + `fromDescList*` functions. (Soumik Sarkar) + ([#1083](https://github.com/haskell/containers/pull/1083)) * Improved performance for `Data.Set`'s `fromList`, `map` and `Data.Map`'s `fromList`, `fromListWith`, `fromListWithKey`, `mapKeys`, `mapKeysWith`. + (Soumik Sarkar) ([#1042](https://github.com/haskell/containers/pull/1042)) * Improved performance for many `Set` and `Map` modification operations, including `insert` and `delete`, by inlining part of the balancing routine. (Soumik Sarkar) + ([#1056](https://github.com/haskell/containers/pull/1056)) -* Improved performance for `IntSet` and `IntMap`'s `Ord` instances. +* Improved performance for `Eq` and `Ord` instances of `Set`, `Map`, `IntSet`, + `IntMap`, `Seq`. (Soumik Sarkar) + ([#1028](https://github.com/haskell/containers/pull/1028), + [#1017](https://github.com/haskell/containers/pull/1017), + [#1035](https://github.com/haskell/containers/pull/1035), + [#1086](https://github.com/haskell/containers/pull/1086), + [#1112](https://github.com/haskell/containers/pull/1112)) + +### Documentation + +* Add and improve documentation (Bodigrim, konsumlamm, Toni Dietze, alexfmpe, + Soumik Sarkar, Jonathan Knowles, Xavier Góngora, Xia Li-yao, eyelash) + ([#957](https://github.com/haskell/containers/pull/957), + [#1006](https://github.com/haskell/containers/pull/1006), + [#877](https://github.com/haskell/containers/pull/877), + [#960](https://github.com/haskell/containers/pull/960), + [#1033](https://github.com/haskell/containers/pull/1033), + [#1041](https://github.com/haskell/containers/pull/1041), + [#1039](https://github.com/haskell/containers/pull/1039), + [#1050](https://github.com/haskell/containers/pull/1050), + [#1088](https://github.com/haskell/containers/pull/1088), + [#1087](https://github.com/haskell/containers/pull/1087), + [#1098](https://github.com/haskell/containers/pull/1098), + [#1106](https://github.com/haskell/containers/pull/1106), + [#1104](https://github.com/haskell/containers/pull/1104), + [#1105](https://github.com/haskell/containers/pull/1105), + [#1111](https://github.com/haskell/containers/pull/1111), + [#1110](https://github.com/haskell/containers/pull/1110), + [#1114](https://github.com/haskell/containers/pull/1114), + [#1115](https://github.com/haskell/containers/pull/1115)) ### Miscellaneous/internal * Internal modules `Utils.Containers.Internal.BitUtil`, `Utils.Containers.Internal.BitQueue`, `Utils.Containers.Internal.StrictPair` - are no longer exposed. - -## Unreleased with `@since` annotation for 0.7.1: - -### Additions - -* Add `Data.Graph.flattenSCC1`. (Andreas Abel) - -* `NFData1`, `NFData2` instances for `SCC`, `IntMap`, `Map`, `Sequence`, `Set`, - `Tree` and relevant internal dependencies (David Beacham) + are no longer exposed. (Soumik Sarkar) + ([#1101](https://github.com/haskell/containers/pull/1101)) + +* Test and CI maintenance. (Andreas Abel, Soumik Sarkar) + ([#986](https://github.com/haskell/containers/pull/986), + [#1015](https://github.com/haskell/containers/pull/1015), + [#1030](https://github.com/haskell/containers/pull/1030), + [#1055](https://github.com/haskell/containers/pull/1055), + [#1067](https://github.com/haskell/containers/pull/1067)) + +* Internal cleanups and improvements. (Soumik Sarkar, alexfmpe) + ([#1000](https://github.com/haskell/containers/pull/1000), + [#959](https://github.com/haskell/containers/pull/959), + [#1020](https://github.com/haskell/containers/pull/1020), + [#1029](https://github.com/haskell/containers/pull/1029), + [#1031](https://github.com/haskell/containers/pull/1031), + [#1037](https://github.com/haskell/containers/pull/1037), + [#1058](https://github.com/haskell/containers/pull/1058), + [#1076](https://github.com/haskell/containers/pull/1076), + [#1084](https://github.com/haskell/containers/pull/1084), + [#1085](https://github.com/haskell/containers/pull/1085), + [#1093](https://github.com/haskell/containers/pull/1093), + [#1094](https://github.com/haskell/containers/pull/1094), + [#1095](https://github.com/haskell/containers/pull/1095), + [#1097](https://github.com/haskell/containers/pull/1097), + [#1103](https://github.com/haskell/containers/pull/1103)) + +* Add new tests and benchmarks (Soumik Sarkar) + ([#962](https://github.com/haskell/containers/pull/962), + [#1021](https://github.com/haskell/containers/pull/1021), + [#1063](https://github.com/haskell/containers/pull/1063), + [#1068](https://github.com/haskell/containers/pull/1068), + [#1071](https://github.com/haskell/containers/pull/1071), + [#1075](https://github.com/haskell/containers/pull/1075), + [#1082](https://github.com/haskell/containers/pull/1082)) + +* Fix the Read the Docs tutorial (Soumik Sarkar) + ([#1091](https://github.com/haskell/containers/pull/1091), + [#1099](https://github.com/haskell/containers/pull/1099)) ## 0.7 diff --git a/containers/containers.cabal b/containers/containers.cabal index db15957c1..d14995ab5 100644 --- a/containers/containers.cabal +++ b/containers/containers.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: containers -version: 0.7 +version: 0.8 license: BSD-3-Clause license-file: LICENSE maintainer: libraries@haskell.org diff --git a/containers/src/Data/Graph.hs b/containers/src/Data/Graph.hs index 23020d428..9f04a8767 100644 --- a/containers/src/Data/Graph.hs +++ b/containers/src/Data/Graph.hs @@ -250,7 +250,7 @@ instance NFData a => NFData (SCC a) where rnf (AcyclicSCC v) = rnf v rnf (NECyclicSCC vs) = rnf vs --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 SCC where liftRnf rnfx (AcyclicSCC v) = rnfx v liftRnf rnfx (NECyclicSCC vs) = liftRnf rnfx vs @@ -279,7 +279,7 @@ flattenSCC (NECyclicSCC (v :| vs)) = v : vs -- | The vertices of a strongly connected component. -- --- @since 0.7.1 +-- @since 0.8 flattenSCC1 :: SCC vertex -> NonEmpty vertex flattenSCC1 (AcyclicSCC v) = v :| [] flattenSCC1 (NECyclicSCC vs) = vs diff --git a/containers/src/Data/IntMap/Internal.hs b/containers/src/Data/IntMap/Internal.hs index cada7ea70..f8ef5600d 100644 --- a/containers/src/Data/IntMap/Internal.hs +++ b/containers/src/Data/IntMap/Internal.hs @@ -531,7 +531,7 @@ instance NFData a => NFData (IntMap a) where rnf (Tip _ v) = rnf v rnf (Bin _ l r) = rnf l `seq` rnf r --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 IntMap where liftRnf rnfx = go where @@ -1355,7 +1355,7 @@ intersectionWithKey f m1 m2 -- fromList [(2,\'b\'),(3,\'r\'),(4,\'w\'),(9,\'s\')] -- @ -- --- @since FIXME +-- @since 0.8 symmetricDifference :: IntMap a -> IntMap a -> IntMap a symmetricDifference t1@(Bin p1 l1 r1) t2@(Bin p2 l2 r2) = case treeTreeBranch p1 p2 of @@ -2694,7 +2694,7 @@ filter p m -- -- > filterKeys (> 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" -- --- @since FIXME +-- @since 0.8 filterKeys :: (Key -> Bool) -> IntMap a -> IntMap a filterKeys predicate = filterWithKey (\k _ -> predicate k) diff --git a/containers/src/Data/IntSet/Internal.hs b/containers/src/Data/IntSet/Internal.hs index cc6f7f13b..4521b6ebc 100644 --- a/containers/src/Data/IntSet/Internal.hs +++ b/containers/src/Data/IntSet/Internal.hs @@ -657,7 +657,7 @@ intersection Nil _ = Nil -- | The intersection of a series of sets. Intersections are performed -- left-to-right. -- --- @since FIXME +-- @since 0.8 intersections :: NonEmpty IntSet -> IntSet intersections (s0 :| ss) | null s0 = empty @@ -675,7 +675,7 @@ intersections (s0 :| ss) -- A @Monoid@ instance is not defined because it would be impractical to -- construct @mempty@, the @IntSet@ containing all @Int@s. -- --- @since FIXME +-- @since 0.8 newtype Intersection = Intersection { getIntersection :: IntSet } deriving (Show, Eq, Ord) @@ -705,7 +705,7 @@ instance Semigroup Intersection where -- symmetricDifference (fromList [0,2,4,6]) (fromList [0,3,6,9]) == fromList [2,3,4,9] -- @ -- --- @since FIXME +-- @since 0.8 symmetricDifference :: IntSet -> IntSet -> IntSet symmetricDifference t1@(Bin p1 l1 r1) t2@(Bin p2 l2 r2) = case treeTreeBranch p1 p2 of @@ -1091,7 +1091,7 @@ lookupMinSure Nil = error "lookupMin Nil" -- | \(O(\min(n,W))\). The minimal element of the set. Returns 'Nothing' if the -- set is empty. -- --- @since FIXME +-- @since 0.8 lookupMin :: IntSet -> Maybe Key lookupMin Nil = Nothing lookupMin (Tip kx bm) = Just $! kx + lowestBitSet bm @@ -1113,7 +1113,7 @@ lookupMaxSure Nil = error "lookupMax Nil" -- | \(O(\min(n,W))\). The maximal element of the set. Returns 'Nothing' if the -- set is empty. -- --- @since FIXME +-- @since 0.8 lookupMax :: IntSet -> Maybe Key lookupMax Nil = Nothing lookupMax (Tip kx bm) = Just $! kx + highestBitSet bm @@ -1247,7 +1247,9 @@ foldl' f z = \t -> -- Use lambda t to be inlinable with two arguments only. go z' (Bin _ l r) = go (go z' l) r {-# INLINE foldl' #-} --- | \(O(n))\). Map the elements in the set to a monoid and combine with @(<>)@. +-- | \(O(n)\). Map the elements in the set to a monoid and combine with @(<>)@. +-- +-- @since 0.8 foldMap :: Monoid a => (Key -> a) -> IntSet -> a foldMap f = \t -> -- Use lambda t to be inlinable with one argument only. case t of diff --git a/containers/src/Data/IntSet/Internal/IntTreeCommons.hs b/containers/src/Data/IntSet/Internal/IntTreeCommons.hs index d361ac4c5..e9f33f2e0 100644 --- a/containers/src/Data/IntSet/Internal/IntTreeCommons.hs +++ b/containers/src/Data/IntSet/Internal/IntTreeCommons.hs @@ -22,7 +22,7 @@ -- This module defines common constructs used by both "Data.IntSet" and -- "Data.IntMap". -- --- @since FIXME +-- @since 0.8 -- module Data.IntSet.Internal.IntTreeCommons diff --git a/containers/src/Data/Map/Internal.hs b/containers/src/Data/Map/Internal.hs index 8ddfac03a..9461894e4 100644 --- a/containers/src/Data/Map/Internal.hs +++ b/containers/src/Data/Map/Internal.hs @@ -2109,7 +2109,7 @@ intersectionWithKey f (Bin _ k x1 l1 r1) t2 = case mb of -- fromList [(2,\'b\'),(3,\'r\'),(4,\'w\'),(9,\'s\')] -- @ -- --- @since FIXME +-- @since 0.8 symmetricDifference :: Ord k => Map k a -> Map k a -> Map k a symmetricDifference Tip t2 = t2 symmetricDifference t1 Tip = t1 @@ -2956,7 +2956,7 @@ filter p m -- -- > filterKeys (> 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a" -- --- @since FIXME +-- @since 0.8 filterKeys :: (k -> Bool) -> Map k a -> Map k a filterKeys p m = filterWithKey (\k _ -> p k) m @@ -4503,14 +4503,14 @@ instance (NFData k, NFData a) => NFData (Map k a) where rnf Tip = () rnf (Bin _ kx x l r) = rnf kx `seq` rnf x `seq` rnf l `seq` rnf r --- | @since 0.7.1 +-- | @since 0.8 instance NFData k => NFData1 (Map k) where liftRnf rnfx = go where go Tip = () go (Bin _ kx x l r) = rnf kx `seq` rnfx x `seq` go l `seq` go r --- | @since 0.7.1 +-- | @since 0.8 instance NFData2 Map where liftRnf2 rnfkx rnfx = go where diff --git a/containers/src/Data/Sequence/Internal.hs b/containers/src/Data/Sequence/Internal.hs index 9fa069c6a..28e64a79f 100644 --- a/containers/src/Data/Sequence/Internal.hs +++ b/containers/src/Data/Sequence/Internal.hs @@ -502,7 +502,7 @@ instance Traversable Seq where instance NFData a => NFData (Seq a) where rnf (Seq xs) = rnf xs --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 Seq where liftRnf rnfx (Seq xs) = liftRnf (liftRnf rnfx) xs @@ -1214,7 +1214,7 @@ instance NFData a => NFData (FingerTree a) where rnf (Single x) = rnf x rnf (Deep _ pr m sf) = rnf pr `seq` rnf sf `seq` rnf m --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 FingerTree where liftRnf _ EmptyT = () liftRnf rnfx (Single x) = rnfx x @@ -1322,7 +1322,7 @@ instance NFData a => NFData (Digit a) where rnf (Three a b c) = rnf a `seq` rnf b `seq` rnf c rnf (Four a b c d) = rnf a `seq` rnf b `seq` rnf c `seq` rnf d --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 Digit where liftRnf rnfx (One a) = rnfx a liftRnf rnfx (Two a b) = rnfx a `seq` rnfx b @@ -1407,7 +1407,7 @@ instance NFData a => NFData (Node a) where rnf (Node2 _ a b) = rnf a `seq` rnf b rnf (Node3 _ a b c) = rnf a `seq` rnf b `seq` rnf c --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 Node where liftRnf rnfx (Node2 _ a b) = rnfx a `seq` rnfx b liftRnf rnfx (Node3 _ a b c) = rnfx a `seq` rnfx b `seq` rnfx c @@ -1472,7 +1472,7 @@ instance Traversable Elem where instance NFData a => NFData (Elem a) where rnf (Elem x) = rnf x --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 Elem where liftRnf rnfx (Elem x) = rnfx x diff --git a/containers/src/Data/Set/Internal.hs b/containers/src/Data/Set/Internal.hs index f4fd36082..bd62d8563 100644 --- a/containers/src/Data/Set/Internal.hs +++ b/containers/src/Data/Set/Internal.hs @@ -893,7 +893,7 @@ intersection t1@(Bin _ x l1 r1) t2 -- | The intersection of a series of sets. Intersections are performed -- left-to-right. -- --- @since FIXME +-- @since 0.8 intersections :: Ord a => NonEmpty (Set a) -> Set a intersections (s0 :| ss) | null s0 = empty @@ -908,7 +908,7 @@ intersections (s0 :| ss) -- | @Set@s form a 'Semigroup' under 'intersection'. -- --- @since FIXME +-- @since 0.8 newtype Intersection a = Intersection { getIntersection :: Set a } deriving (Show, Eq, Ord) @@ -940,7 +940,7 @@ instance (Ord a) => Semigroup (Intersection a) where -- symmetricDifference (fromList [0,2,4,6]) (fromList [0,3,6,9]) == fromList [2,3,4,9] -- @ -- --- @since FIXME +-- @since 0.8 symmetricDifference :: Ord a => Set a -> Set a -> Set a symmetricDifference Tip t2 = t2 symmetricDifference t1 Tip = t1 @@ -1377,7 +1377,7 @@ instance NFData a => NFData (Set a) where rnf Tip = () rnf (Bin _ y l r) = rnf y `seq` rnf l `seq` rnf r --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 Set where liftRnf rnfx = go where diff --git a/containers/src/Data/Tree.hs b/containers/src/Data/Tree.hs index 091c89129..0f164f24b 100644 --- a/containers/src/Data/Tree.hs +++ b/containers/src/Data/Tree.hs @@ -309,7 +309,7 @@ foldlMap1 f g = -- Use a lambda to allow inlining with two arguments instance NFData a => NFData (Tree a) where rnf (Node x ts) = rnf x `seq` rnf ts --- | @since 0.7.1 +-- | @since 0.8 instance NFData1 Tree where liftRnf rnfx = go where @@ -565,7 +565,7 @@ unfoldForestQ f aQ = case viewl aQ of -- >>> leaves (Node "root" []) -- ["root"] -- --- @since FIXME +-- @since 0.8 leaves :: Tree a -> [a] #ifdef __GLASGOW_HASKELL__ leaves t = GHC.Exts.build $ \cons nil -> @@ -602,7 +602,7 @@ leaves t = -- >>> edges (Node "root" []) -- [] -- --- @since FIXME +-- @since 0.8 edges :: Tree a -> [(a, a)] #ifdef __GLASGOW_HASKELL__ edges (Node x0 ts0) = GHC.Exts.build $ \cons nil -> @@ -630,7 +630,7 @@ edges (Node x0 ts0) = -- >>> pathsToRoot (Node "root" []) -- Node {rootLabel = "root" :| [], subForest = []} -- --- @since FIXME +-- @since 0.8 pathsToRoot :: Tree a -> Tree (NonEmpty a) pathsToRoot = go [] where @@ -654,7 +654,7 @@ pathsToRoot = go [] -- >>> pathsFromRoot (Node "root" []) -- Node {rootLabel = "root" :| [], subForest = []} -- --- @since FIXME +-- @since 0.8 -- See Note [pathsFromRoot implementation] pathsFromRoot :: Tree a -> Tree (NonEmpty a) @@ -691,7 +691,7 @@ toNonEmptyBQ (BQ x0 _ f r) = case r of -- | A newtype over 'Tree' that folds and traverses in post-order. -- --- @since FIXME +-- @since 0.8 newtype PostOrder a = PostOrder { unPostOrder :: Tree a } #ifdef __GLASGOW_HASKELL__ deriving (Eq, Ord, Read, Show, Data, Generic, Generic1, Lift) From 47d0a0085132f600000e242aaaa04ceb5c0ddbc5 Mon Sep 17 00:00:00 2001 From: meooow25 Date: Wed, 26 Feb 2025 01:35:47 +0530 Subject: [PATCH 2/4] Regenerate CI config --- .github/workflows/haskell-ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index abdde4082..1a1d65aec 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20241219 +# version: 0.19.20250216 # -# REGENDATA ("0.19.20241219",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"]) +# REGENDATA ("0.19.20250216",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"]) # name: Haskell-CI on: @@ -23,7 +23,7 @@ on: jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 60 container: @@ -103,11 +103,10 @@ jobs: mkdir -p "$HOME/.ghcup/bin" curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - - name: Install cabal-install (prerelease) + - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; - "$HOME/.ghcup/bin/ghcup" install cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -vnormal+nowrap" >> "$GITHUB_ENV" + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - name: Install GHC (GHCup) if: matrix.setup-method == 'ghcup' run: | @@ -132,7 +131,7 @@ jobs: echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi + if [ $((HCNUMVER > 91201)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} @@ -228,6 +227,7 @@ jobs: echo "package containers-tests" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project From 5c708b9013f3ad23cde45a09ec08988b2adfc18e Mon Sep 17 00:00:00 2001 From: meooow25 Date: Fri, 28 Feb 2025 21:14:53 +0530 Subject: [PATCH 3/4] Tweak --- containers/changelog.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/containers/changelog.md b/containers/changelog.md index f7839a72a..739e18186 100644 --- a/containers/changelog.md +++ b/containers/changelog.md @@ -22,9 +22,8 @@ least 2 entries with equal keys. (Soumik Sarkar) ([#1023](https://github.com/haskell/containers/pull/1023)) -* `Data.Set.fold` and `Data.IntSet.fold` have long been documented as - deprecated and are now marked as such. They will be removed in a future - release. (Soumik Sarkar) +* `Data.Set.fold` and `Data.IntSet.fold` are deprecated. One should instead use + `Data.Set.foldr` and `Data.IntSet.foldr`. (Soumik Sarkar) ([#1049](https://github.com/haskell/containers/pull/1049)) * For `Data.IntMap.{Lazy,Strict}`, `updateMin`, `updateMax`, `updateMinWithKey`, @@ -37,7 +36,7 @@ structures in the library. (Soumik Sarkar) ([#1077](https://github.com/haskell/containers/pull/1077)) -* Various deprecated functions, whose definitions currently cause type errors, +* Some long deprecated functions, whose definitions currently cause type errors, have been removed. (Soumik Sarkar) ([#1046](https://github.com/haskell/containers/pull/1046)) @@ -104,7 +103,8 @@ ### Performance improvements * The internal representations of `IntMap` and `IntSet` have been changed - to be a little more memory efficient. (Soumik Sarkar) + to be a little more memory efficient. Consequently, many functions on + `IntMap`s and `IntSet`s are a little faster now. (Soumik Sarkar) ([#995](https://github.com/haskell/containers/pull/995), [#998](https://github.com/haskell/containers/pull/998)) @@ -112,7 +112,7 @@ (Soumik Sarkar) ([#1001](https://github.com/haskell/containers/pull/1001)) * For `Data.Graph.SCC`, `Foldable.toList` and `Foldable1.toNonEmpty` now - do not perform a copy. (Soumik Sarkar) + do not perform an unnecessary copy. (Soumik Sarkar) ([#1057](https://github.com/haskell/containers/pull/1057)) * Improved performance for `Data.Intset`'s `foldr`, `foldl'`, `foldl`, `foldr'`. @@ -191,7 +191,8 @@ [#1094](https://github.com/haskell/containers/pull/1094), [#1095](https://github.com/haskell/containers/pull/1095), [#1097](https://github.com/haskell/containers/pull/1097), - [#1103](https://github.com/haskell/containers/pull/1103)) + [#1103](https://github.com/haskell/containers/pull/1103), + [#1117](https://github.com/haskell/containers/pull/1117)) * Add new tests and benchmarks (Soumik Sarkar) ([#962](https://github.com/haskell/containers/pull/962), From 2825e56633050101a0a054f03e4336f6d0536f74 Mon Sep 17 00:00:00 2001 From: meooow25 Date: Sat, 1 Mar 2025 11:30:56 +0530 Subject: [PATCH 4/4] More tweaks --- containers/changelog.md | 13 +++++++------ containers/src/Data/Graph.hs | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/containers/changelog.md b/containers/changelog.md index 739e18186..5ae0b6400 100644 --- a/containers/changelog.md +++ b/containers/changelog.md @@ -32,8 +32,8 @@ ([#1065](https://github.com/haskell/containers/pull/1065)) * `foldl'` and `foldr'` for `Seq` are now strict in the initial value. This - matches the behavior of the default implementations and of the other - structures in the library. (Soumik Sarkar) + matches the behavior of the default implementations and of other structures in + the library. (Soumik Sarkar) ([#1077](https://github.com/haskell/containers/pull/1077)) * Some long deprecated functions, whose definitions currently cause type errors, @@ -42,13 +42,14 @@ ### Bug fixes -* Make the package compile with MicroHs. (Lennart Augustsson) +* Make the package compile with [MicroHs](https://github.com/augustss/MicroHs). + (Lennart Augustsson) ([#1043](https://github.com/haskell/containers/pull/1043), [#1081](https://github.com/haskell/containers/pull/1081)) * Fix a strictness bug in `Data.Map.Strict.fromDistinctAscList` and - `Data.Map.Strict.fromDistinctDescList` where all values were not forced. - This bug affects versions 0.6.8 and 0.7. (Neil Mayhew) + `Data.Map.Strict.fromDistinctDescList` where all values were not forced to + WHNF. This bug affects versions 0.6.8 and 0.7. (Neil Mayhew) ([#996](https://github.com/haskell/containers/pull/996)) * Fix a bug in `Data.IntMap`'s `isProperSubmapOfBy` where it could incorrectly @@ -108,7 +109,7 @@ ([#995](https://github.com/haskell/containers/pull/995), [#998](https://github.com/haskell/containers/pull/998)) -* Improved performance for `Data.Map`'s `minViewSure` and `maxViewSure`. +* Improved performance for `Data.Map`'s `minView`, `maxView`, `difference`. (Soumik Sarkar) ([#1001](https://github.com/haskell/containers/pull/1001)) * For `Data.Graph.SCC`, `Foldable.toList` and `Foldable1.toNonEmpty` now diff --git a/containers/src/Data/Graph.hs b/containers/src/Data/Graph.hs index 9f04a8767..39ca3e500 100644 --- a/containers/src/Data/Graph.hs +++ b/containers/src/Data/Graph.hs @@ -164,7 +164,7 @@ data SCC vertex | NECyclicSCC {-# UNPACK #-} !(NonEmpty vertex) -- ^ A maximal set of mutually reachable vertices. -- - -- @since 0.7.0 + -- @since 0.7 deriving ( Eq -- ^ @since 0.5.9 , Show -- ^ @since 0.5.9 , Read -- ^ @since 0.5.9 @@ -228,7 +228,7 @@ instance F.Foldable SCC where toList = flattenSCC #if MIN_VERSION_base(4,18,0) --- | @since 0.7.0 +-- | @since 0.7 instance F1.Foldable1 SCC where foldMap1 f (AcyclicSCC v) = f v foldMap1 f (NECyclicSCC vs) = F1.foldMap1 f vs