containers 0.6.3.1 → 0.6.4.1
raw patch · 9 files changed
+49/−44 lines, 9 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Graph: reverseTopSort :: Graph -> [Vertex]
+ Data.IntMap.Lazy: traverseMaybeWithKey :: Applicative f => (Key -> a -> f (Maybe b)) -> IntMap a -> f (IntMap b)
+ Data.IntMap.Strict: traverseMaybeWithKey :: Applicative f => (Key -> a -> f (Maybe b)) -> IntMap a -> f (IntMap b)
Files
- changelog.md +22/−0
- containers.cabal +2/−2
- src/Data/Graph.hs +7/−0
- src/Data/IntMap/Internal.hs +6/−0
- src/Data/IntMap/Lazy.hs +1/−0
- src/Data/IntMap/Strict.hs +1/−0
- src/Data/IntMap/Strict/Internal.hs +3/−21
- src/Data/Map/Internal.hs +4/−0
- src/Data/Map/Strict/Internal.hs +3/−21
changelog.md view
@@ -1,5 +1,27 @@ # Changelog for [`containers` package](http://github.com/haskell/containers) +## [0.6.4.1]++### Bug fixes++* [Replace value-forcing variants of `compose` with lazy variants.](https://github.com/haskell/containers/pull/745)+ * This brings `compose` closer in line with functions like `union` and `intersection` which don't evaluate any map values. (Thanks, Simon Jakobi)++### Additions++* [Add `reverseTopSort` to `Data.Graph`](https://github.com/haskell/containers/pull/638) (Thanks, James Parker)++* [Expose `traverseMaybeWithKey` from `Data.IntMap.{Lazy,Strict}`](https://github.com/haskell/containers/pull/743) (Thanks, Simon+ Jakobi)++### Other changes++* Improvements to the testsuite: [#663](https://github.com/haskell/containers/pull/663), [#662](https://github.com/haskell/containers/pull/662) (Thanks, Bertram Felgenhauer)++* [Fix build with `stack test`](https://github.com/haskell/containers/pull/738) (Thanks, Simon Jakobi)++[0.6.4.1]: https://github.com/haskell/containers/compare/v0.6.3.1-release...v0.6.4.1+ ## 0.6.3.1 ### Bug fixes
containers.cabal view
@@ -1,5 +1,5 @@ name: containers-version: 0.6.3.1+version: 0.6.4.1 license: BSD3 license-file: LICENSE maintainer: libraries@haskell.org@@ -25,7 +25,7 @@ include/containers.h changelog.md -tested-with: GHC==8.8.2, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3+tested-with: GHC==8.10.1, GHC==8.8.2, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3 source-repository head type: git
src/Data/Graph.hs view
@@ -67,6 +67,7 @@ , dfs , dff , topSort+ , reverseTopSort , components , scc , bcc@@ -616,6 +617,12 @@ -- precedes /j/ whenever /j/ is reachable from /i/ but not vice versa. topSort :: Graph -> [Vertex] topSort = reverse . postOrd++-- | Reverse ordering of `topSort`.+--+-- @since 0.6.4+reverseTopSort :: Graph -> [Vertex]+reverseTopSort = postOrd ------------------------------------------------------------ -- Algorithm 3: connected components
src/Data/IntMap/Internal.hs view
@@ -783,6 +783,10 @@ -- ('compose' bc ab '!?') = (bc '!?') <=< (ab '!?') -- @ --+-- __Note:__ Prior to v0.6.4, "Data.IntMap.Strict" exposed a version of+-- 'compose' that forced the values of the output 'IntMap'. This version does+-- not force these values.+-- -- @since 0.6.3.1 compose :: IntMap c -> IntMap Int -> IntMap c compose bc !ab@@ -1891,6 +1895,8 @@ -- | /O(n)/. Traverse keys\/values and collect the 'Just' results.+--+-- @since 0.6.4 traverseMaybeWithKey :: Applicative f => (Key -> a -> f (Maybe b)) -> IntMap a -> f (IntMap b) traverseMaybeWithKey f = go
src/Data/IntMap/Lazy.hs view
@@ -157,6 +157,7 @@ , IM.map , mapWithKey , traverseWithKey+ , traverseMaybeWithKey , mapAccum , mapAccumWithKey , mapAccumRWithKey
src/Data/IntMap/Strict.hs view
@@ -176,6 +176,7 @@ , map , mapWithKey , traverseWithKey+ , traverseMaybeWithKey , mapAccum , mapAccumWithKey , mapAccumRWithKey
src/Data/IntMap/Strict/Internal.hs view
@@ -293,6 +293,7 @@ , foldrWithKey' , keysSet , mergeWithKey'+ , compose , delete , deleteMin , deleteMax@@ -719,27 +720,6 @@ = mergeWithKey' bin (\(Tip k1 x1) (Tip _k2 x2) -> Tip k1 $! f k1 x1 x2) (const Nil) (const Nil) m1 m2 {--------------------------------------------------------------------- Compose---------------------------------------------------------------------}--- | Relate the keys of one map to the values of--- the other, by using the values of the former as keys for lookups--- in the latter.------ Complexity: \( O(n * \min(m,W)) \), where \(m\) is the size of the first argument------ > compose (fromList [('a', "A"), ('b', "B")]) (fromList [(1,'a'),(2,'b'),(3,'z')]) = fromList [(1,"A"),(2,"B")]------ @--- ('compose' bc ab '!?') = (bc '!?') <=< (ab '!?')--- @------ @since 0.6.3.1-compose :: IntMap c -> IntMap Int -> IntMap c-compose bc !ab- | null bc = empty- | otherwise = mapMaybe (bc !?) ab--{-------------------------------------------------------------------- MergeWithKey --------------------------------------------------------------------} @@ -923,6 +903,8 @@ {-# INLINE traverseWithKey #-} -- | /O(n)/. Traverse keys\/values and collect the 'Just' results.+--+-- @since 0.6.4 traverseMaybeWithKey :: Applicative f => (Key -> a -> f (Maybe b)) -> IntMap a -> f (IntMap b) traverseMaybeWithKey f = go
src/Data/Map/Internal.hs view
@@ -2106,6 +2106,10 @@ -- ('compose' bc ab '!?') = (bc '!?') <=< (ab '!?') -- @ --+-- __Note:__ Prior to v0.6.4, "Data.Map.Strict" exposed a version of+-- 'compose' that forced the values of the output 'Map'. This version does not+-- force these values.+-- -- @since 0.6.3.1 compose :: Ord b => Map b c -> Map a b -> Map a c compose bc !ab
src/Data/Map/Strict/Internal.hs view
@@ -335,6 +335,7 @@ , balance , balanceL , balanceR+ , compose , elemAt , elems , empty@@ -854,6 +855,8 @@ -- -- Note: 'alterF' is a flipped version of the @at@ combinator from -- @Control.Lens.At@.+--+-- @since 0.5.8 alterF :: (Functor f, Ord k) => (Maybe a -> f (Maybe a)) -> k -> Map k a -> f (Map k a) alterF f k m = atKeyImpl Strict k f m@@ -1202,27 +1205,6 @@ forceMaybe Nothing = Nothing forceMaybe m@(Just !_) = m {-# INLINE forceMaybe #-}--{--------------------------------------------------------------------- Compose---------------------------------------------------------------------}--- | Relate the keys of one map to the values of--- the other, by using the values of the former as keys for lookups--- in the latter.------ Complexity: \( O (n * \log(m)) \), where \(m\) is the size of the first argument------ > compose (fromList [('a', "A"), ('b', "B")]) (fromList [(1,'a'),(2,'b'),(3,'z')]) = fromList [(1,"A"),(2,"B")]------ @--- ('compose' bc ab '!?') = (bc '!?') <=< (ab '!?')--- @------ @since 0.6.3.1-compose :: Ord b => Map b c -> Map a b -> Map a c-compose bc !ab- | null bc = empty- | otherwise = mapMaybe (bc !?) ab {-------------------------------------------------------------------- MergeWithKey