pandora-0.2.0: A box of patterns and paradigms

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 #

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

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
 Source # Instance detailsDefined 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 # (Extractable t, Pointable t, Extractable u, Pointable u) => Adjoint (Yoneda t) (Yoneda u) Source # Instance detailsDefined 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 (Storage s) (Stateful s) Source # Instance detailsDefined in Pandora.Paradigm.Inventory.Optics Methods(-|) :: a -> (Storage s a -> b) -> Stateful s b Source #(|-) :: Storage s a -> (a -> Stateful s b) -> b Source #phi :: (Storage s a -> b) -> a -> Stateful s b Source #psi :: (a -> Stateful s b) -> Storage s a -> b Source #eta :: a -> (Stateful s :. Storage s) > a Source #epsilon :: ((Storage s :. Stateful s) > a) -> a Source # Adjoint (Product a) ((->) a :: Type -> Type) Source # Instance detailsDefined 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 #