Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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))mapMaybe
g .mapMaybe
f =mapMaybe
(g<=<
f)
Laws if
:Foldable
f
mapMaybe :: (a -> Maybe b) -> f a -> f b Source #
catMaybes :: f (Maybe a) -> f a Source #
filter :: (a -> Bool) -> f a -> f a Source #
mapMaybeA :: (Traversable f, Applicative p) => (a -> p (Maybe b)) -> f a -> p (f b) Source #
filterA :: (Traversable f, Applicative p) => (a -> p Bool) -> f a -> p (f a) Source #
mapEither :: (a -> Either b c) -> f a -> (f b, f c) Source #
mapEitherA :: (Traversable f, Applicative p) => (a -> p (Either b c)) -> f a -> p (f b, f c) Source #
partitionEithers :: f (Either a b) -> (f a, f b) Source #