filter -package:base package:pipes -is:exact

(filter predicate) only forwards values that satisfy the predicate.
filter (pure True) = cat

filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2

filter f = mapMaybe (\a -> a <$ guard (f a))
(filterM predicate) only forwards values that satisfy the monadic predicate
filterM (pure (pure True)) = cat

filterM (liftA2 (liftA2 (&&)) p1 p2) = filterM p1 >-> filterM p2

filterM f = wither (\a -> (\b -> a <$ guard b) <$> f a)