pandora-0.3.1: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.Adjoint

Synopsis

Documentation

type (-|) = Adjoint infixl 4 Source #

class (Covariant t, Covariant u) => Adjoint t u where Source #

When providing a new instance, you should ensure it satisfies the four laws:
* Left adjunction identity: phi cozero ≡ identity
* Right adjunction identity: psi zero ≡ identity
* Left adjunction interchange: phi f ≡ comap f . eta
* Right adjunction interchange: psi f ≡ epsilon . comap f

Minimal complete definition

(-|), (|-)

Methods

(-|) :: a -> (t a -> b) -> u b infixl 4 Source #

Left adjunction

(|-) :: t a -> (a -> u b) -> b infixl 4 Source #

Right adjunction

phi :: (t a -> b) -> a -> u b Source #

Prefix and flipped version of -|

psi :: (a -> u b) -> t a -> b Source #

Prefix and flipped version of |-

eta :: a -> (u :. t) := a Source #

Also known as unit

epsilon :: ((t :. u) := a) -> a Source #

Also known as counit

Instances
Adjoint Identity Identity Source # 
Instance details

Defined in Pandora.Paradigm.Primary.Functor.Identity

Methods

(-|) :: a -> (Identity a -> b) -> Identity b Source #

(|-) :: Identity a -> (a -> Identity b) -> b Source #

phi :: (Identity a -> b) -> a -> Identity b Source #

psi :: (a -> Identity b) -> Identity a -> b Source #

eta :: a -> (Identity :. Identity) := a Source #

epsilon :: ((Identity :. Identity) := a) -> a Source #

(Extractable t, Pointable t, Extractable u, Pointable u) => Adjoint (Yoneda t) (Yoneda u) Source # 
Instance details

Defined in Pandora.Paradigm.Primary.Transformer.Yoneda

Methods

(-|) :: a -> (Yoneda t a -> b) -> Yoneda u b Source #

(|-) :: Yoneda t a -> (a -> Yoneda u b) -> b Source #

phi :: (Yoneda t a -> b) -> a -> Yoneda u b Source #

psi :: (a -> Yoneda u b) -> Yoneda t a -> b Source #

eta :: a -> (Yoneda u :. Yoneda t) := a Source #

epsilon :: ((Yoneda t :. Yoneda u) := a) -> a Source #

Adjoint (Equipment e) (Environment e) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory

Methods

(-|) :: a -> (Equipment e a -> b) -> Environment e b Source #

(|-) :: Equipment e a -> (a -> Environment e b) -> b Source #

phi :: (Equipment e a -> b) -> a -> Environment e b Source #

psi :: (a -> Environment e b) -> Equipment e a -> b Source #

eta :: a -> (Environment e :. Equipment e) := a Source #

epsilon :: ((Equipment e :. Environment e) := a) -> a Source #

Adjoint (Accumulator e) (Imprint e) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory

Methods

(-|) :: a -> (Accumulator e a -> b) -> Imprint e b Source #

(|-) :: Accumulator e a -> (a -> Imprint e b) -> b Source #

phi :: (Accumulator e a -> b) -> a -> Imprint e b Source #

psi :: (a -> Imprint e b) -> Accumulator e a -> b Source #

eta :: a -> (Imprint e :. Accumulator e) := a Source #

epsilon :: ((Accumulator e :. Imprint e) := a) -> a Source #

Adjoint (Store s) (State s) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory

Methods

(-|) :: a -> (Store s a -> b) -> State s b Source #

(|-) :: Store s a -> (a -> State s b) -> b Source #

phi :: (Store s a -> b) -> a -> State s b Source #

psi :: (a -> State s b) -> Store s a -> b Source #

eta :: a -> (State s :. Store s) := a Source #

epsilon :: ((Store s :. State s) := a) -> a Source #

Adjoint (Product s) ((->) s :: Type -> Type) Source # 
Instance details

Defined in Pandora.Paradigm.Primary.Functor

Methods

(-|) :: a -> (Product s a -> b) -> s -> b Source #

(|-) :: Product s a -> (a -> s -> b) -> b Source #

phi :: (Product s a -> b) -> a -> s -> b Source #

psi :: (a -> s -> b) -> Product s a -> b Source #

eta :: a -> ((->) s :. Product s) := a Source #

epsilon :: ((Product s :. (->) s) := a) -> a Source #

(Covariant (t <.:> v), Covariant (w <:.> u), Adjoint v u, Adjoint t w) => Adjoint (t <.:> v) (w <:.> u) Source # 
Instance details

Defined in Pandora.Paradigm.Schemes

Methods

(-|) :: a -> ((t <.:> v) a -> b) -> (w <:.> u) b Source #

(|-) :: (t <.:> v) a -> (a -> (w <:.> u) b) -> b Source #

phi :: ((t <.:> v) a -> b) -> a -> (w <:.> u) b Source #

psi :: (a -> (w <:.> u) b) -> (t <.:> v) a -> b Source #

eta :: a -> ((w <:.> u) :. (t <.:> v)) := a Source #

epsilon :: (((t <.:> v) :. (w <:.> u)) := a) -> a Source #

(Covariant (t <.:> v), Covariant (w <.:> u), Adjoint t u, Adjoint v w) => Adjoint (t <.:> v) (w <.:> u) Source # 
Instance details

Defined in Pandora.Paradigm.Schemes

Methods

(-|) :: a -> ((t <.:> v) a -> b) -> (w <.:> u) b Source #

(|-) :: (t <.:> v) a -> (a -> (w <.:> u) b) -> b Source #

phi :: ((t <.:> v) a -> b) -> a -> (w <.:> u) b Source #

psi :: (a -> (w <.:> u) b) -> (t <.:> v) a -> b Source #

eta :: a -> ((w <.:> u) :. (t <.:> v)) := a Source #

epsilon :: (((t <.:> v) :. (w <.:> u)) := a) -> a Source #

(Covariant (v <:.> t), Covariant (w <.:> u), Adjoint t u, Adjoint v w) => Adjoint (v <:.> t) (w <.:> u) Source # 
Instance details

Defined in Pandora.Paradigm.Schemes

Methods

(-|) :: a -> ((v <:.> t) a -> b) -> (w <.:> u) b Source #

(|-) :: (v <:.> t) a -> (a -> (w <.:> u) b) -> b Source #

phi :: ((v <:.> t) a -> b) -> a -> (w <.:> u) b Source #

psi :: (a -> (w <.:> u) b) -> (v <:.> t) a -> b Source #

eta :: a -> ((w <.:> u) :. (v <:.> t)) := a Source #

epsilon :: (((v <:.> t) :. (w <.:> u)) := a) -> a Source #

(Covariant (v <:.> t), Covariant (u <:.> w), Adjoint t u, Adjoint v w) => Adjoint (v <:.> t) (u <:.> w) Source # 
Instance details

Defined in Pandora.Paradigm.Schemes

Methods

(-|) :: a -> ((v <:.> t) a -> b) -> (u <:.> w) b Source #

(|-) :: (v <:.> t) a -> (a -> (u <:.> w) b) -> b Source #

phi :: ((v <:.> t) a -> b) -> a -> (u <:.> w) b Source #

psi :: (a -> (u <:.> w) b) -> (v <:.> t) a -> b Source #

eta :: a -> ((u <:.> w) :. (v <:.> t)) := a Source #

epsilon :: (((v <:.> t) :. (u <:.> w)) := a) -> a Source #

(Covariant ((t <:<.>:> u) t'), Covariant ((v <:<.>:> w) v'), Adjoint t w, Adjoint t' v', Adjoint t v, Adjoint u v, Adjoint v' t') => Adjoint ((t <:<.>:> u) t') ((v <:<.>:> w) v') Source # 
Instance details

Defined in Pandora.Paradigm.Schemes

Methods

(-|) :: a -> ((t <:<.>:> u) t' a -> b) -> (v <:<.>:> w) v' b Source #

(|-) :: (t <:<.>:> u) t' a -> (a -> (v <:<.>:> w) v' b) -> b Source #

phi :: ((t <:<.>:> u) t' a -> b) -> a -> (v <:<.>:> w) v' b Source #

psi :: (a -> (v <:<.>:> w) v' b) -> (t <:<.>:> u) t' a -> b Source #

eta :: a -> ((v <:<.>:> w) v' :. (t <:<.>:> u) t') := a Source #

epsilon :: (((t <:<.>:> u) t' :. (v <:<.>:> w) v') := a) -> a Source #