Instant is
off
Search plugin
Manual
haskell.org
filter
-containers +base
Packages
containers
base
filter
:: (a -> Bool) -> [a] -> [a]
base
Prelude
,
base
Data.List
filter
, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e., > filter p xs = [ x | x <- xs, p x]
filter
M
:: Monad m => (a -> m Bool) -> [a] -> m [a]
base
Control.Monad
This generalizes the list-based
filter
function.
m
filter
:: MonadPlus m => (a -> Bool) -> m a -> m a
base
Control.Monad
Direct
MonadPlus
equivalent of
filter
filter
= (mfilter:: (a -> Bool) -> [a] -> [a] applicable to any
MonadPlus
, for example mfilter odd (Just 1) == Just 1 mfilter odd (Just 2) == Nothing