mono-traversable 1.0.11.0 → 1.0.12.0
raw patch · 3 files changed
+39/−16 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Containers: filterSet :: IsSet set => (Element set -> Bool) -> set -> set
Files
- ChangeLog.md +5/−0
- mono-traversable.cabal +16/−16
- src/Data/Containers.hs +18/−0
ChangeLog.md view
@@ -1,3 +1,8 @@+## 1.0.12.0+* Added `filterSet` to `Data.Containers`+* Use container specific implementations for `filterSet` and `filterMap`+ [#178](https://github.com/snoyberg/mono-traversable/pull/178)+ ## 1.0.11.0 * Adding monomorphic instances for GHC.Generics and Data.Proxy types
mono-traversable.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.1.+-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack ----- hash: d58c5bc6fce9bf509cf559fa04639076650c2e3c940a7a1d113ea8f647a49335+-- hash: bb2c95aee7a253f7f93bf9fb96eeb108b577eb9e3bf4015d290187a0f4dafc28 name: mono-traversable-version: 1.0.11.0+version: 1.0.12.0 synopsis: Type classes for mapping, folding, and traversing monomorphic containers description: Please see the README at <https://www.stackage.org/package/mono-traversable> category: Data@@ -27,6 +27,14 @@ location: https://github.com/snoyberg/mono-traversable library+ exposed-modules:+ Data.Containers+ Data.MonoTraversable+ Data.MonoTraversable.Unprefixed+ Data.NonNull+ Data.Sequences+ other-modules:+ Paths_mono_traversable hs-source-dirs: src ghc-options: -Wall@@ -44,19 +52,14 @@ if impl(ghc <8.0) build-depends: semigroups >=0.10- exposed-modules:- Data.Containers- Data.MonoTraversable- Data.MonoTraversable.Unprefixed- Data.NonNull- Data.Sequences- other-modules:- Paths_mono_traversable default-language: Haskell2010 test-suite test type: exitcode-stdio-1.0 main-is: main.hs+ other-modules:+ Spec+ Paths_mono_traversable hs-source-dirs: test ghc-options: -O0@@ -74,14 +77,13 @@ , transformers , unordered-containers , vector- other-modules:- Spec- Paths_mono_traversable default-language: Haskell2010 benchmark sorting type: exitcode-stdio-1.0 main-is: sorting.hs+ other-modules:+ Paths_mono_traversable hs-source-dirs: bench ghc-options: -Wall -O2@@ -91,6 +93,4 @@ , mono-traversable , mwc-random , vector- other-modules:- Paths_mono_traversable default-language: Haskell2010
src/Data/Containers.hs view
@@ -616,6 +616,8 @@ {-# INLINE mapWithKey #-} omapKeysWith = Map.mapKeysWith {-# INLINE omapKeysWith #-}+ filterMap = Map.filter+ {-# INLINE filterMap #-} #if MIN_VERSION_containers(0, 5, 0) -- | This instance uses the functions from "Data.HashMap.Strict".@@ -653,6 +655,8 @@ --unionsWith = HashMap.unionsWith --mapWithKey = HashMap.mapWithKey --mapKeysWith = HashMap.mapKeysWith+ filterMap = HashMap.filter+ {-# INLINE filterMap #-} #if MIN_VERSION_containers(0, 5, 0) -- | This instance uses the functions from "Data.IntMap.Strict".@@ -703,6 +707,8 @@ omapKeysWith = IntMap.mapKeysWith {-# INLINE omapKeysWith #-} #endif+ filterMap = IntMap.filter+ {-# INLINE filterMap #-} instance Eq key => IsMap [(key, value)] where type MapValue [(key, value)] = value@@ -736,6 +742,12 @@ -- | Convert a set to a list. setToList :: set -> [Element set] + -- | Filter values in a set.+ --+ -- @since 1.0.12.0+ filterSet :: (Element set -> Bool) -> set -> set+ filterSet p = setFromList . filter p . setToList+ instance Ord element => IsSet (Set.Set element) where insertSet = Set.insert {-# INLINE insertSet #-}@@ -747,6 +759,8 @@ {-# INLINE setFromList #-} setToList = Set.toList {-# INLINE setToList #-}+ filterSet = Set.filter+ {-# INLINE filterSet #-} instance (Eq element, Hashable element) => IsSet (HashSet.HashSet element) where insertSet = HashSet.insert@@ -759,6 +773,8 @@ {-# INLINE setFromList #-} setToList = HashSet.toList {-# INLINE setToList #-}+ filterSet = HashSet.filter+ {-# INLINE filterSet #-} instance IsSet IntSet.IntSet where insertSet = IntSet.insert@@ -771,6 +787,8 @@ {-# INLINE setFromList #-} setToList = IntSet.toList {-# INLINE setToList #-}+ filterSet = IntSet.filter+ {-# INLINE filterSet #-} -- | Zip operations on 'MonoFunctor's.