Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- class Functor f => Filtrable f where
- mapMaybeA :: (Filtrable f, Traversable f, Applicative p) => (a -> p (Maybe b)) -> f a -> p (f b)
- filterA :: (Filtrable f, Traversable f, Applicative p) => (a -> p Bool) -> f a -> p (f a)
Documentation
class Functor f => Filtrable f where Source
Laws:
mapMaybe
Just
= idmapMaybe
f =catMaybes
∘fmap
fcatMaybes
=mapMaybe
idfilter
f =mapMaybe
(\ x ->bool
Nothing
(Just
x) (f x))
Laws if
:Foldable
f
mapMaybeA :: (Filtrable f, Traversable f, Applicative p) => (a -> p (Maybe b)) -> f a -> p (f b) Source
filterA :: (Filtrable f, Traversable f, Applicative p) => (a -> p Bool) -> f a -> p (f a) Source