From 65881748d661680fdf83f7d1934194e784b00b44 Mon Sep 17 00:00:00 2001 From: Simon Jakobi Date: Fri, 21 May 2021 23:38:53 +0200 Subject: [PATCH] Prepare release 0.2.14.0 (#315) --- CHANGES.md | 10 ++++++++++ Data/HashMap/Internal.hs | 6 ++++++ Data/HashMap/Internal/Array.hs | 1 + Data/HashSet/Internal.hs | 1 + unordered-containers.cabal | 2 +- 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 8046e000..a07b02a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,13 @@ +## [0.2.14.0] + +* [Add `HashMap.mapKeys`.](https://github.com/haskell-unordered-containers/unordered-containers/pull/308) Thanks, Marco Perone! + +* [Add instances for `NFData1` and `NFData2`.](https://github.com/haskell-unordered-containers/unordered-containers/pull/314) Thanks, Isaac Elliott and Oleg Grenrus! + +* [Fix `@since`-annotation for `compose`.](https://github.com/haskell-unordered-containers/unordered-containers/pull/303) Thanks, @Mathnerd314! + +[0.2.14.0]: https://github.com/haskell-unordered-containers/unordered-containers/compare/v0.2.13.0...v0.2.14.0 + ## [0.2.13.0] * [Add `HashMap.compose`.](https://github.com/haskell-unordered-containers/unordered-containers/pull/299) Thanks Alexandre Esteves. diff --git a/Data/HashMap/Internal.hs b/Data/HashMap/Internal.hs index 7b5956dc..ca9188d8 100644 --- a/Data/HashMap/Internal.hs +++ b/Data/HashMap/Internal.hs @@ -206,9 +206,11 @@ instance (NFData k, NFData v) => NFData (Leaf k v) where rnf (L k v) = rnf k `seq` rnf v #if MIN_VERSION_deepseq(1,4,3) +-- | @since 0.2.14.0 instance NFData k => NF.NFData1 (Leaf k) where liftRnf rnf2 = NF.liftRnf2 rnf rnf2 +-- | @since 0.2.14.0 instance NF.NFData2 Leaf where liftRnf2 rnf1 rnf2 (L k v) = rnf1 k `seq` rnf2 v #endif @@ -236,9 +238,11 @@ instance (NFData k, NFData v) => NFData (HashMap k v) where rnf (Collision _ ary) = rnf ary #if MIN_VERSION_deepseq(1,4,3) +-- | @since 0.2.14.0 instance NFData k => NF.NFData1 (HashMap k) where liftRnf rnf2 = NF.liftRnf2 rnf rnf2 +-- | @since 0.2.14.0 instance NF.NFData2 HashMap where liftRnf2 _ _ Empty = () liftRnf2 rnf1 rnf2 (BitmapIndexed _ ary) = NF.liftRnf (NF.liftRnf2 rnf1 rnf2) ary @@ -1789,6 +1793,8 @@ traverseWithKey f = go -- fromList [(1,"c")] -- >>> mapKeys (\ _ -> 3) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) -- fromList [(3,"c")] +-- +-- @since 0.2.14.0 mapKeys :: (Eq k2, Hashable k2) => (k1 -> k2) -> HashMap k1 v -> HashMap k2 v mapKeys f = fromList . foldrWithKey (\k x xs -> (f k, x) : xs) [] diff --git a/Data/HashMap/Internal/Array.hs b/Data/HashMap/Internal/Array.hs index fcef3f6e..97e6015f 100644 --- a/Data/HashMap/Internal/Array.hs +++ b/Data/HashMap/Internal/Array.hs @@ -255,6 +255,7 @@ rnfArray ary0 = go ary0 n0 0 {-# INLINE rnfArray #-} #if MIN_VERSION_deepseq(1,4,3) +-- | @since 0.2.14.0 instance NF.NFData1 Array where liftRnf = liftRnfArray diff --git a/Data/HashSet/Internal.hs b/Data/HashSet/Internal.hs index a46731e3..417a9804 100644 --- a/Data/HashSet/Internal.hs +++ b/Data/HashSet/Internal.hs @@ -143,6 +143,7 @@ instance (NFData a) => NFData (HashSet a) where {-# INLINE rnf #-} #if MIN_VERSION_deepseq(1,4,3) +-- | @since 0.2.14.0 instance NF.NFData1 HashSet where liftRnf rnf1 = NF.liftRnf2 rnf1 rnf . asMap #endif diff --git a/unordered-containers.cabal b/unordered-containers.cabal index e951abb3..9949a64d 100644 --- a/unordered-containers.cabal +++ b/unordered-containers.cabal @@ -1,5 +1,5 @@ name: unordered-containers -version: 0.2.13.0 +version: 0.2.14.0 synopsis: Efficient hashing-based container types description: Efficient hashing-based container types. The containers have been