profunctor-arrows-0.0.1: Profunctor arrows

Safe HaskellSafe
LanguageHaskell2010

Data.Profunctor.Arrow

Synopsis

Documentation

type (+) = Either #

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 #

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

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

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

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

swap :: (a, b) -> (b, a) #

Swap the components of a pair.

eswap :: (a1 + a2) -> a2 + a1 #

fork :: a -> (a, a) #

join :: (a + a) -> a #

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

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

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

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

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

assocr :: ((a, b), c) -> (a, (b, c)) 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 #