| Copyright | (c) Anton Gushcha, 2015-2016 Oganyan Levon, 2016 |
|---|---|
| License | BSD3 |
| Maintainer | ncrashed@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Filterable
Description
Defines generic filter utilities for collections.
- class Filterable f where
- type FilterConstraint f o :: Constraint
- fNull :: FilterConstraint f a => f a -> Bool
- fFilter :: FilterConstraint f a => (a -> Bool) -> f a -> f a
- fFilterM :: (FilterConstraint f a, Monad m) => (a -> m Bool) -> f a -> m (f a)
- newtype KeyHashMap v k = KeyHashMap {
- unKeyHashMap :: HashMap k v
Documentation
class Filterable f where Source
Generic filter for collections
Methods
fNull :: FilterConstraint f a => f a -> Bool Source
Test collection for emptiness
fFilter :: FilterConstraint f a => (a -> Bool) -> f a -> f a Source
Filter function for collection
fFilterM :: (FilterConstraint f a, Monad m) => (a -> m Bool) -> f a -> m (f a) Source
Monad version of filter
Instances
| Filterable [] Source | |
| Filterable Seq Source | |
| (Eq k, Hashable k) => Filterable (HashMap k) Source | |
| Filterable (KeyHashMap v) Source |
newtype KeyHashMap v k Source
Wrapper around HashMap to Filterable instance over keys
Constructors
| KeyHashMap | |
Fields
| |
Instances
| Filterable (KeyHashMap v) Source | |
| type FilterConstraint (KeyHashMap v) o = (Eq o, Hashable o) Source |