packages feed

unordered-containers 0.2.12.0 → 0.2.13.0

raw patch · 6 files changed

+44/−3 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.HashMap.Internal: compose :: (Eq b, Hashable b) => HashMap b c -> HashMap a b -> HashMap a c
+ Data.HashMap.Internal.Strict: compose :: (Eq b, Hashable b) => HashMap b c -> HashMap a b -> HashMap a c
+ Data.HashMap.Lazy: compose :: (Eq b, Hashable b) => HashMap b c -> HashMap a b -> HashMap a c
+ Data.HashMap.Strict: compose :: (Eq b, Hashable b) => HashMap b c -> HashMap a b -> HashMap a c

Files

CHANGES.md view
@@ -1,3 +1,9 @@+## [0.2.13.0]++* [Add `HashMap.compose`.](https://github.com/haskell-unordered-containers/unordered-containers/pull/299) Thanks Alexandre Esteves.++[0.2.13.0]: https://github.com/haskell-unordered-containers/unordered-containers/compare/v0.2.12.0...v0.2.13.0+ ## [0.2.12.0]  * Add `HashMap.isSubmapOf[By]` and `HashSet.isSubsetOf`. Thanks Sven Keidel. ([#282])@@ -7,7 +13,7 @@ * Documentation improvements in `Data.HashSet`, including a beginner-friendly   introduction. Thanks Matt Renaud. ([#267]) -* `HashMap[.Strict].alterF`: Skip key deletion for absent keys. ([#288])+* `HashMap.alterF`: Skip key deletion for absent keys. ([#288])  * Remove custom `unsafeShift{L,R}` definitions. ([#281]) 
Data/HashMap/Internal.hs view
@@ -60,6 +60,9 @@     , unionWithKey     , unions +    -- ** Compose+    , compose+       -- * Transformations     , map     , mapWithKey@@ -418,7 +421,7 @@ #endif  -- | The ordering is total and consistent with the `Eq` instance. However,--- nothing else about the ordering is specified, and it may change from +-- nothing else about the ordering is specified, and it may change from -- version to version of either this package or of hashable. instance (Ord k, Ord v) => Ord (HashMap k v) where     compare = cmp compare compare@@ -1678,6 +1681,29 @@ unions :: (Eq k, Hashable k) => [HashMap k v] -> HashMap k v unions = L.foldl' union empty {-# INLINE unions #-}+++------------------------------------------------------------------------+-- * 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 UNRELEASED+compose :: (Eq b, Hashable b) => HashMap b c -> HashMap a b -> HashMap a c+compose bc !ab+  | null bc = empty+  | otherwise = mapMaybe (bc !?) ab  ------------------------------------------------------------------------ -- * Transformations
Data/HashMap/Internal/Strict.hs view
@@ -74,6 +74,9 @@     , unionWithKey     , unions +    -- ** Compose+    , compose+       -- * Transformations     , map     , mapWithKey
Data/HashMap/Lazy.hs view
@@ -59,6 +59,9 @@     , unionWithKey     , unions +    -- ** Compose+    , compose+       -- * Transformations     , map     , mapWithKey
Data/HashMap/Strict.hs view
@@ -58,6 +58,9 @@     , unionWithKey     , unions +    -- ** Compose+    , compose+       -- * Transformations     , map     , mapWithKey
unordered-containers.cabal view
@@ -1,5 +1,5 @@ name:           unordered-containers-version:        0.2.12.0+version:        0.2.13.0 synopsis:       Efficient hashing-based container types description:   Efficient hashing-based container types.  The containers have been