Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Synopsis
- class (Functor f, Functor g) => Adjunction f g | f -> g, g -> f where
- leftAdjunct :: (f a -> b) -> a -> g b
- unit :: a -> g (f a)
- rightAdjunct :: (a -> g b) -> f a -> b
- counit :: f (g b) -> b
- embed_adjunction :: (Adjunction f g, Adjunction g f) => (f a -> f b) -> a -> b
- zipR :: Adjunction f u => (u a, u b) -> u (a, b)
- cozipL :: Adjunction f u => f (Either a b) -> Either (f a) (f b)
- swap :: (b, a) -> (a, b)
- data AdjM f g a = AdjM {
- runAdjM :: g (f a)
Documentation
class (Functor f, Functor g) => Adjunction f g | f -> g, g -> f where Source #
The problem with this type class is that categories are not represented at all. This assumes all functors are F : C -> C. This is a standard definition of adjunction from category theory.
Nothing
leftAdjunct :: (f a -> b) -> a -> g b Source #
rightAdjunct :: (a -> g b) -> f a -> b Source #
Instances
Adjunction StreamIndex Stream Source # | |
Defined in Math.Number.Stream leftAdjunct :: (StreamIndex a -> b) -> a -> Stream b Source # unit :: a -> Stream (StreamIndex a) Source # rightAdjunct :: (a -> Stream b) -> StreamIndex a -> b Source # counit :: StreamIndex (Stream b) -> b Source # | |
Adjunction ((,) a) ((->) a) Source # | |
Defined in Math.Tools.Adjunction |
embed_adjunction :: (Adjunction f g, Adjunction g f) => (f a -> f b) -> a -> b Source #
zipR :: Adjunction f u => (u a, u b) -> u (a, b) Source #
zipR and cozipL are from Edward Kmett's Adjunction package http://hackage.haskell.org/packages/archive/adjunctions/0.9.0.4/doc/html/src/Data-Functor-Adjunction.html
cozipL :: Adjunction f u => f (Either a b) -> Either (f a) (f b) Source #
zipR and cozipL are from Edward Kmett's Adjunction package http://hackage.haskell.org/packages/archive/adjunctions/0.9.0.4/doc/html/src/Data-Functor-Adjunction.html
Instances
(Applicative f, Applicative g) => Applicative (AdjM f g) Source # | |
(Functor f, Functor g) => Functor (AdjM f g) Source # | |
(Adjunction f g, Applicative f, Applicative g) => Monad (AdjM f g) Source # | |