distributors-0.3.0.0: Unifying Parsers, Printers & Grammars
Copyright(C) 2026 - Eitan Chatav
LicenseBSD-style (see the file LICENSE)
MaintainerEitan Chatav <eitan.chatav@gmail.com>
Stabilityprovisional
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Profunctor.Filtrator

Contents

Description

 
Synopsis

Filtrator

class (Cochoice p, forall x. Filterable (p x)) => Filtrator p where Source #

The Filtrator class extends Cochoice, as well as Filterable, adding the filtrate method, which is an oplax monoidal structure morphism dual to >+<.

filtrate . uncurry (>+<) = id
uncurry (>+<) . filtrate = id

Minimal complete definition

Nothing

Methods

filtrate :: p (Either a c) (Either b d) -> (p a b, p c d) Source #

unleft = fst . filtrate
unright = snd . filtrate

filtrate is a distant relative to partitionEithers.

filtrate has a default for Choice.

default filtrate :: Choice p => p (Either a c) (Either b d) -> (p a b, p c d) Source #

Instances

Instances details
Filtrator p => Filtrator (Coyoneda p) Source # 
Instance details

Defined in Data.Profunctor.Filtrator

Methods

filtrate :: Coyoneda p (Either a c) (Either b d) -> (Coyoneda p a b, Coyoneda p c d) Source #

Filtrator p => Filtrator (Yoneda p) Source # 
Instance details

Defined in Data.Profunctor.Filtrator

Methods

filtrate :: Yoneda p (Either a c) (Either b d) -> (Yoneda p a b, Yoneda p c d) Source #

Filtrator (Binocular a b) Source # 
Instance details

Defined in Control.Lens.Bifocal

Methods

filtrate :: Binocular a b (Either a0 c) (Either b0 d) -> (Binocular a b a0 b0, Binocular a b c d) Source #

Filtrator (PartialExchange a b) Source # 
Instance details

Defined in Data.Profunctor.Filtrator

Methods

filtrate :: PartialExchange a b (Either a0 c) (Either b0 d) -> (PartialExchange a b a0 b0, PartialExchange a b c d) Source #

Filterable f => Filtrator (Parsor s f) Source # 
Instance details

Defined in Data.Profunctor.Grammar

Methods

filtrate :: Parsor s f (Either a c) (Either b d) -> (Parsor s f a b, Parsor s f c d) Source #

Filterable f => Filtrator (Printor s f) Source # 
Instance details

Defined in Data.Profunctor.Grammar

Methods

filtrate :: Printor s f (Either a c) (Either b d) -> (Printor s f a b, Printor s f c d) Source #

(Profunctor p, forall x. Functor (p x), Filterable f) => Filtrator (WrappedPafb f p) Source # 
Instance details

Defined in Data.Profunctor.Filtrator

Methods

filtrate :: WrappedPafb f p (Either a c) (Either b d) -> (WrappedPafb f p a b, WrappedPafb f p c d) Source #

Filtrator (Forget r :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Filtrator

Methods

filtrate :: Forget r (Either a c) (Either b d) -> (Forget r a b, Forget r c d) Source #

(Filterable f, Traversable f) => Filtrator (Star f) Source # 
Instance details

Defined in Data.Profunctor.Filtrator

Methods

filtrate :: Star f (Either a c) (Either b d) -> (Star f a b, Star f c d) Source #

mfiltrate :: (Monadic p, Alternator p) => p (Either a c) (Either b d) -> (p a b, p c d) Source #

mfiltrate can be used as filtrate, for Monadic Alternators.

mfiltrate = filtrate