Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for 0.8 #1116

Merged
merged 4 commits into from
Mar 1, 2025
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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: |
Expand All @@ -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 }}
Expand Down Expand Up @@ -228,6 +227,7 @@ jobs:
echo "package containers-tests" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: all:containers
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
Expand Down
9 changes: 7 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -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
180 changes: 149 additions & 31 deletions containers/changelog.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,212 @@
# Changelog for [`containers` package](http://github.com/haskell/containers)

## Next release
## 0.8 *March 2025*

### Breaking changes

* `Data.IntMap.Lazy.split`, `Data.IntMap.Strict.split`,
`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)
([#1023](https://github.com/haskell/containers/pull/1023))

* Various deprecated functions, whose definitions currently cause type errors,
have been removed. (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`,
`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))

* `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.
* `foldl'` and `foldr'` for `Seq` are now strict in the initial value. This
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,
have been removed. (Soumik Sarkar)
([#1046](https://github.com/haskell/containers/pull/1046))

### 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 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
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. 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))

* 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
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'`.
(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),
[#1117](https://github.com/haskell/containers/pull/1117))

* 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

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.7
version: 0.8
license: BSD-3-Clause
license-file: LICENSE
maintainer: libraries@haskell.org
Expand Down
8 changes: 4 additions & 4 deletions containers/src/Data/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading