class (Functor f, Representable u) => Adjunction (f :: Type -> Type) (u :: Type -> Type) | f -> u, u -> f whereAn adjunction between Hask and Hask.
Minimal definition: both unit and counit or both leftAdjunct and rightAdjunct, subject to the constraints imposed by the default definitions that the following laws should hold.
unit = leftAdjunct id
counit = rightAdjunct id
leftAdjunct f = fmap f . unit
rightAdjunct f = counit . fmap fAny implementation is required to ensure that leftAdjunct and
rightAdjunct witness an isomorphism from Nat (f a, b) to
Nat (a, g b)
rightAdjunct unit = id
leftAdjunct counit = idMethods
unit :: a -> u (f a)counit :: f (u a) -> aleftAdjunct :: (f a -> b) -> a -> u brightAdjunct :: (a -> u b) -> f a -> b
Instances13Adjunction, …
Adjunction Identity IdentityDefined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction Par1 Par1Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction V1 U1Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction f u => Adjunction (Free f) (Cofree u)Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction (Tuple2 e) ((->) e)Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction f g => Adjunction (Rec1 f) (Rec1 g)Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction f g => Adjunction (IdentityT f) (IdentityT g)Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction m w => Adjunction (WriterT s m) (TracedT s w)Defined in adjunctions-4.4.3 · Data.Functor.AdjunctionAdjunction w m => Adjunction (EnvT e w) (ReaderT e m)Defined in adjunctions-4.4.3 · Data.Functor.Adjunction(Adjunction f g, Adjunction f' g') => Adjunction (Sum f f') (Product g g')Defined in adjunctions-4.4.3 · Data.Functor.Adjunction(Adjunction f g, Adjunction f' g') => Adjunction (f :+: f') (g :*: g')Defined in adjunctions-4.4.3 · Data.Functor.Adjunction(Adjunction f g, Adjunction f' g') => Adjunction (Compose f' f) (Compose g g')Defined in adjunctions-4.4.3 · Data.Functor.Adjunction(Adjunction f g, Adjunction f' g') => Adjunction (f' :.: f) (g :.: g')Defined in adjunctions-4.4.3 · Data.Functor.Adjunction