- class (Contravariant f, Contravariant g) => Adjunction f g | f -> g, g -> f where
- unit :: a -> g (f a)
- counit :: a -> f (g a)
- leftAdjunct :: (b -> f a) -> a -> g b
- rightAdjunct :: (a -> g b) -> b -> f a

- data Representation f x = Representation {}
- repAdjunction :: Adjunction f g => Representation g (f ())
- repFlippedAdjunction :: Adjunction f g => Representation f (g ())

# Documentation

class (Contravariant f, Contravariant g) => Adjunction f g | f -> g, g -> f whereSource

An adjunction from Hask^op to Hask

Op (f a) b ~ Hask a (g b)

rightAdjunct unit = id leftAdjunct counit = id

leftAdjunct :: (b -> f a) -> a -> g bSource

rightAdjunct :: (a -> g b) -> b -> f aSource

Adjunction Predicate Predicate | This gives rise to the Cont Bool monad |

Adjunction (Op r) (Op r) | This adjunction gives rise to the Cont monad |

repAdjunction :: Adjunction f g => Representation g (f ())Source

Represent a contravariant functor that has a left adjoint

repFlippedAdjunction :: Adjunction f g => Representation f (g ())Source