pandora-0.2.8: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.Adjoint

Synopsis

Documentation

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 (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 (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 (Product a) ((->) a :: Type -> Type) Source # 
Instance details

Defined in Pandora.Paradigm.Primary.Functor.Product

Methods

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

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

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

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

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

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

(Covariant (UT Covariant Covariant t v), Covariant (TU Covariant Covariant w u), Adjoint v u, Adjoint t w) => Adjoint (UT Covariant Covariant t v) (TU Covariant Covariant w u) Source # 
Instance details

Defined in Pandora.Paradigm.Controlflow.Joint.Schemes

Methods

(-|) :: a -> (UT Covariant Covariant t v a -> b) -> TU Covariant Covariant w u b Source #

(|-) :: UT Covariant Covariant t v a -> (a -> TU Covariant Covariant w u b) -> b Source #

phi :: (UT Covariant Covariant t v a -> b) -> a -> TU Covariant Covariant w u b Source #

psi :: (a -> TU Covariant Covariant w u b) -> UT Covariant Covariant t v a -> b Source #

eta :: a -> (TU Covariant Covariant w u :. UT Covariant Covariant t v) := a Source #

epsilon :: ((UT Covariant Covariant t v :. TU Covariant Covariant w u) := a) -> a Source #

(Covariant (UT Covariant Covariant t v), Covariant (UT Covariant Covariant w u), Adjoint t u, Adjoint v w) => Adjoint (UT Covariant Covariant t v) (UT Covariant Covariant w u) Source # 
Instance details

Defined in Pandora.Paradigm.Controlflow.Joint.Schemes

Methods

(-|) :: a -> (UT Covariant Covariant t v a -> b) -> UT Covariant Covariant w u b Source #

(|-) :: UT Covariant Covariant t v a -> (a -> UT Covariant Covariant w u b) -> b Source #

phi :: (UT Covariant Covariant t v a -> b) -> a -> UT Covariant Covariant w u b Source #

psi :: (a -> UT Covariant Covariant w u b) -> UT Covariant Covariant t v a -> b Source #

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

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

(Covariant (TU Covariant Covariant v t), Covariant (UT Covariant Covariant w u), Adjoint t u, Adjoint v w) => Adjoint (TU Covariant Covariant v t) (UT Covariant Covariant w u) Source # 
Instance details

Defined in Pandora.Paradigm.Controlflow.Joint.Schemes

Methods

(-|) :: a -> (TU Covariant Covariant v t a -> b) -> UT Covariant Covariant w u b Source #

(|-) :: TU Covariant Covariant v t a -> (a -> UT Covariant Covariant w u b) -> b Source #

phi :: (TU Covariant Covariant v t a -> b) -> a -> UT Covariant Covariant w u b Source #

psi :: (a -> UT Covariant Covariant w u b) -> TU Covariant Covariant v t a -> b Source #

eta :: a -> (UT Covariant Covariant w u :. TU Covariant Covariant v t) := a Source #

epsilon :: ((TU Covariant Covariant v t :. UT Covariant Covariant w u) := a) -> a Source #

(Covariant (TU Covariant Covariant v t), Covariant (TU Covariant Covariant u w), Adjoint t u, Adjoint v w) => Adjoint (TU Covariant Covariant v t) (TU Covariant Covariant u w) Source # 
Instance details

Defined in Pandora.Paradigm.Controlflow.Joint.Schemes

Methods

(-|) :: a -> (TU Covariant Covariant v t a -> b) -> TU Covariant Covariant u w b Source #

(|-) :: TU Covariant Covariant v t a -> (a -> TU Covariant Covariant u w b) -> b Source #

phi :: (TU Covariant Covariant v t a -> b) -> a -> TU Covariant Covariant u w b Source #

psi :: (a -> TU Covariant Covariant u w b) -> TU Covariant Covariant v t a -> b Source #

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

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

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

Defined in Pandora.Paradigm.Controlflow.Joint.Schemes

type (-|) = Adjoint infixl 4 Source #