Skip to content

Contravariant functor subclass #4

@no-longer-on-githu-b

Description

@no-longer-on-githu-b

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions