adjunctions-4.0.2: Adjunctions and representable functors

PortabilityMPTCs
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy

Data.Functor.Contravariant.Adjunction

Description

 

Synopsis

Documentation

class (Contravariant f, Representable 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

Any adjunction from Hask to Hask^op would indirectly permit unsafePerformIO, and therefore does not exist.

Methods

unit :: a -> g (f a)Source

counit :: a -> f (g a)Source

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

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

Instances

Adjunction Predicate Predicate

This gives rise to the Cont Bool Monad

Adjunction (Op r) (Op r)

This Adjunction gives rise to the Cont Monad

contrarepAdjunction :: Adjunction f g => (a -> f ()) -> g aSource

Represent a Contravariant functor that has a left adjoint

coindexAdjunction :: Adjunction f g => g a -> a -> f ()Source