It is useful to have:
class (Contravariant f) <= Contrafilterable f where
cfilter :: forall a. (a -> Boolean) -> f a -> f a
cfilterCmap :: forall a b. (b -> Maybe a) -> f a -> f b
cpartition :: ...
cpartitionCmap :: ...
An example use case is my logging library, which currently provides this method as a function: https://pursuit.purescript.org/packages/purescript-logging/0.0.3/docs/Control.Logger#v:cfilter
It is useful to have:
An example use case is my logging library, which currently provides this method as a function: https://pursuit.purescript.org/packages/purescript-logging/0.0.3/docs/Control.Logger#v:cfilter