HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleadjunctions-4.4.3Haskell2010

Data.Functor.Adjunction

  • 1 class
  • 14 values
  • Packageadjunctions-4.4.3
  • Exports15
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceAdjunction.hs
classclass (Functor f, Representable u) => Adjunction (f :: Type -> Type) (u :: Type -> Type) | f -> u, u -> f where
#

An 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 f

Any 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 = id

Methods

Instances13Adjunction, …
valuetabulateAdjunction :: Adjunction f u => (f () -> b) -> u b
#

Every right adjoint is representable by its left adjoint applied to a unit element

Use this definition and the primitives in Data.Functor.Representable to meet the requirements of the superclasses of Representable.

valueindexAdjunction :: Adjunction f u => u b -> f a -> b
#

This definition admits a default definition for the index method of 'Index", one of the superclasses of Representable.

valuezipR :: Adjunction f u => (u a, u b) -> u (a, b)
#

A right adjoint functor admits an intrinsic notion of zipping

valueunzipR :: Functor u => u (a, b) -> (u a, u b)
#

Every functor in Haskell permits unzipping