profunctor-misc-0.0.0.1: Profunctor miscellany

Data.Profunctor.Misc

Synopsis

# Documentation

type (+) = Either infixr 5 Source #

rgt :: (a -> b) -> (a + b) -> b Source #

rgt' :: (Void + b) -> b Source #

lft :: (b -> a) -> (a + b) -> a Source #

lft' :: (a + Void) -> a Source #

dup :: a -> (a, a) Source #

dedup :: (a + a) -> a Source #

swp :: (a1, a2) -> (a2, a1) Source #

swp' :: (a1 + a2) -> a2 + a1 Source #

assocl :: (a, (b, c)) -> ((a, b), c) Source #

assocr :: ((a, b), c) -> (a, (b, c)) Source #

assocl' :: (a + (b + c)) -> (a + b) + c Source #

assocr' :: ((a + b) + c) -> a + (b + c) Source #

eval :: (a, a -> b) -> b Source #

apply :: (b -> a, b) -> a Source #

coeval :: b -> ((b -> a) + a) -> a Source #

branch :: (a -> Bool) -> b -> c -> a -> b + c Source #

branch' :: (a -> Bool) -> a -> a + a Source #

fstrong :: Functor f => f a -> b -> f (a, b) Source #

fchoice :: Traversable f => f (a + b) -> f a + b Source #

pfirst :: Strong p => p a b -> p (a, c) (b, c) Source #

psecond :: Strong p => p a b -> p (c, a) (c, b) Source #

pleft :: Choice p => p a b -> p (a + c) (b + c) Source #

pright :: Choice p => p a b -> p (c + a) (c + b) Source #

pcurry :: Closed p => p (a, b) c -> p a (b -> c) Source #

puncurry :: Strong p => p a (b -> c) -> p (a, b) c Source #

peval :: Strong p => p a (a -> b) -> p a b Source #

constl :: Profunctor p => b -> p b c -> p a c Source #

constr :: Profunctor p => c -> p a b -> p a c Source #

shiftl :: Profunctor p => p (a + b) c -> p b (c + d) Source #

shiftr :: Profunctor p => p b (c, d) -> p (a, b) c Source #

coercer :: Profunctor p => Contravariant (p a) => p a c -> p a d Source #

coercer' :: Representable p => Contravariant (Rep p) => p a b -> p a c Source #

coercel :: Profunctor p => Bifunctor p => p a c -> p b c Source #

coercel' :: Corepresentable p => Contravariant (Corep p) => p a b -> p c b Source #

strong :: Strong p => ((a, b) -> c) -> p a b -> p a c Source #

costrong :: Costrong p => ((a, b) -> c) -> p c a -> p b a Source #

choice :: Choice p => (c -> a + b) -> p b a -> p c a Source #

cochoice :: Cochoice p => (c -> a + b) -> p a c -> p a b Source #

pull :: Strong p => p a b -> p a (a, b) Source #

parr :: Category p => Profunctor p => (a -> b) -> p a b Source #

punarr :: Comonad w => Sieve p w => p a b -> a -> b Source #

returnP :: Category p => Profunctor p => p a a Source #

ex1 :: Category p => Profunctor p => p (a, b) b Source #

ex2 :: Category p => Profunctor p => p (a, b) a Source #

inl :: Category p => Profunctor p => p a (a + b) Source #

inr :: Category p => Profunctor p => p b (a + b) Source #

braid :: Category p => Profunctor p => p (a, b) (b, a) Source #

braid' :: Category p => Profunctor p => p (a + b) (b + a) Source #

lift :: Representable p => ((a -> Rep p b) -> s -> Rep p t) -> p a b -> p s t Source #

lower :: Corepresentable p => ((Corep p a -> b) -> Corep p s -> t) -> p a b -> p s t Source #

(@@@) :: Profunctor p => (forall x. Applicative (p x)) => p a1 b1 -> p a2 b2 -> p (a1, a2) (b1, b2) infixr 3 Source #

TODO: Document

p * x ≡ dimap dup eval (p @ x)

pappend :: Profunctor p => (forall x. Applicative (p x)) => p a1 b1 -> p a2 b2 -> p (a1, a2) (b1, b2) Source #

pdivide :: Profunctor p => (forall x. Applicative (p x)) => (a -> (a1, a2)) -> p a1 b -> p a2 b -> p a b Source #

Profunctor equivalent of divide.

pdivided :: Profunctor p => (forall x. Applicative (p x)) => p a1 b -> p a2 b -> p (a1, a2) b Source #

Profunctor equivalent of divided.

papply :: Profunctor p => (forall x. Applicative (p x)) => p a (b -> c) -> p a b -> p a c Source #

Profunctor equivalent of <*>.

pliftA2 :: Profunctor p => (forall x. Applicative (p x)) => ((b1, b2) -> b) -> p a b1 -> p a b2 -> p a b Source #

Profunctor equivalent of liftA2.

ppure :: Profunctor p => (forall x. Applicative (p x)) => b -> p a b Source #

pabsurd :: Profunctor p => (forall x. Divisible (p x)) => p Void a Source #