pandora-0.2.5: 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.Basis.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 #

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

Defined in Pandora.Paradigm.Inventory.Optics

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 #

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

Defined in Pandora.Paradigm.Basis.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 (Product a) ((->) a :: Type -> Type) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.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 #

type (-|) = Adjoint infixl 4 Source #