profunctor-arrows-0.0.0.2: Profunctor arrows

Safe HaskellSafe
LanguageHaskell2010

Data.Profunctor.Arrow

Synopsis

Documentation

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

Lift a function into a profunctor arrow.

Usable w arrow syntax w the Arrows & RebindableSyntax extensions.

(a >>> b) >>> c = a >>> (b >>> c)
arr f >>> a = dimap f id a
a >>> arr f = dimap id f a
arr (g . f) = arr f >>> arr g

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 #

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

loop :: Costrong p => p (a, d) (b, d) -> p a b Source #

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

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

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

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

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

(***) :: Category p => Strong p => p a1 b1 -> p a2 b2 -> p (a1, a2) (b1, b2) infixr 3 Source #

(+++) :: Category p => Choice p => p a1 b1 -> p a2 b2 -> p (a1 + a2) (b1 + b2) infixr 2 Source #

(&&&) :: Category p => Strong p => p a b1 -> p a b2 -> p a (b1, b2) infixr 3 Source #

(|||) :: Category p => Choice p => p a1 b -> p a2 b -> p (a1 + a2) b infixr 2 Source #

($$$) :: Category p => Strong p => p a (b -> c) -> p a b -> p a c infixr 0 Source #

adivide :: Category p => Strong p => (a -> (a1, a2)) -> p a1 b -> p a2 b -> p a b Source #

adivide' :: Category p => Strong p => p a b -> p a b -> p a b Source #

adivided :: Category p => Strong p => p a1 b -> p a2 b -> p (a1, a2) b Source #

aselect :: Category p => Choice p => ((b1 + b2) -> b) -> p a b1 -> p a b2 -> p a b Source #

aselect' :: Category p => Choice p => p a b -> p a b -> p a b Source #

aselected :: Category p => Choice p => p a b1 -> p a b2 -> p a (b1 + b2) Source #