cifl-math-library-1.1.1.0: Math libraries
Safe HaskellTrustworthy
LanguageHaskell2010

Math.Tools.Adjunction

Synopsis

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.

Minimal complete definition

Nothing

Methods

leftAdjunct :: (f a -> b) -> a -> g b Source #

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

rightAdjunct :: (a -> g b) -> f a -> b Source #

counit :: f (g b) -> b Source #

Instances

Instances details
Adjunction StreamIndex Stream Source # 
Instance details

Defined in Math.Number.Stream

Methods

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 # 
Instance details

Defined in Math.Tools.Adjunction

Methods

leftAdjunct :: ((a, a0) -> b) -> a0 -> a -> b Source #

unit :: a0 -> a -> (a, a0) Source #

rightAdjunct :: (a0 -> a -> b) -> (a, a0) -> b Source #

counit :: (a, a -> b) -> b Source #

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 #

cozipL :: Adjunction f u => f (Either a b) -> Either (f a) (f b) Source #

swap :: (b, a) -> (a, b) Source #

data AdjM f g a Source #

Constructors

AdjM 

Fields

Instances

Instances details
(Applicative f, Applicative g) => Applicative (AdjM f g) Source # 
Instance details

Defined in Math.Tools.Adjunction

Methods

pure :: a -> AdjM f g a #

(<*>) :: AdjM f g (a -> b) -> AdjM f g a -> AdjM f g b #

liftA2 :: (a -> b -> c) -> AdjM f g a -> AdjM f g b -> AdjM f g c #

(*>) :: AdjM f g a -> AdjM f g b -> AdjM f g b #

(<*) :: AdjM f g a -> AdjM f g b -> AdjM f g a #

(Functor f, Functor g) => Functor (AdjM f g) Source # 
Instance details

Defined in Math.Tools.Adjunction

Methods

fmap :: (a -> b) -> AdjM f g a -> AdjM f g b #

(<$) :: a -> AdjM f g b -> AdjM f g a #

(Adjunction f g, Applicative f, Applicative g) => Monad (AdjM f g) Source # 
Instance details

Defined in Math.Tools.Adjunction

Methods

(>>=) :: AdjM f g a -> (a -> AdjM f g b) -> AdjM f g b #

(>>) :: AdjM f g a -> AdjM f g b -> AdjM f g b #

return :: a -> AdjM f g a #