pandora-0.1.2: 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 counit ≡ identity
* Right adjunction identity: psi unit ≡ identity
* Left adjunction interchange: phi f ≡ comap f . eta
* Right adjunction interchange: psi f ≡ epsilon . comap f

Minimal complete definition

phi, psi

Methods

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

Left adjunction

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

Right adjunction

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

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

Instances
Adjoint Identity Identity Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Identity

Methods

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.Basis.Yoneda

Methods

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

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 #

(t :-|: u, v :-|: w) => Adjoint (U Co Co t v) (U Co Co u w) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Composition

Methods

phi :: (U Co Co t v a -> b) -> a -> U Co Co u w b Source #

psi :: (a -> U Co Co u w b) -> U Co Co t v a -> b Source #

eta :: a -> (U Co Co u w :.: U Co Co t v) a Source #

epsilon :: (U Co Co t v :.: U Co Co u w) a -> a Source #

(t :-|: w, v :-|: x, u :-|: y) => Adjoint (UU Co Co Co t v u) (UU Co Co Co w x y) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Composition

Methods

phi :: (UU Co Co Co t v u a -> b) -> a -> UU Co Co Co w x y b Source #

psi :: (a -> UU Co Co Co w x y b) -> UU Co Co Co t v u a -> b Source #

eta :: a -> (UU Co Co Co w x y :.: UU Co Co Co t v u) a Source #

epsilon :: (UU Co Co Co t v u :.: UU Co Co Co w x y) a -> a Source #

(t :-|: u, v :-|: w, q :-|: q, r :-|: s) => Adjoint (UUU Co Co Co Co t v q r) (UUU Co Co Co Co u w q s) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Composition

Methods

phi :: (UUU Co Co Co Co t v q r a -> b) -> a -> UUU Co Co Co Co u w q s b Source #

psi :: (a -> UUU Co Co Co Co u w q s b) -> UUU Co Co Co Co t v q r a -> b Source #

eta :: a -> (UUU Co Co Co Co u w q s :.: UUU Co Co Co Co t v q r) a Source #

epsilon :: (UUU Co Co Co Co t v q r :.: UUU Co Co Co Co u w q s) a -> a Source #