data-category-0.10: Category theory

LicenseBSD-style (see the file LICENSE)
Maintainersjoerd@w3future.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Category.Kleisli

Description

This is an attempt at the Kleisli category, and the construction of an adjunction for each monad.

Documentation

data Kleisli m a b where Source #

Constructors

Kleisli :: (Functor m, Dom m ~ k, Cod m ~ k) => Monad m -> Obj k b -> k a (m :% b) -> Kleisli m a b 
Instances
Category (Kleisli m :: Type -> Type -> Type) Source #

The category of Kleisli arrows.

Instance details

Defined in Data.Category.Kleisli

Methods

src :: Kleisli m a b -> Obj (Kleisli m) a Source #

tgt :: Kleisli m a b -> Obj (Kleisli m) b Source #

(.) :: Kleisli m b c -> Kleisli m a b -> Kleisli m a c Source #

kleisliId :: (Functor m, Dom m ~ k, Cod m ~ k) => Monad m -> Obj k a -> Kleisli m a a Source #

newtype KleisliFree m Source #

Constructors

KleisliFree (Monad m) 
Instances
(Functor m, Dom m ~ k, Cod m ~ k) => Functor (KleisliFree m) Source # 
Instance details

Defined in Data.Category.Kleisli

Associated Types

type Dom (KleisliFree m) :: Type -> Type -> Type Source #

type Cod (KleisliFree m) :: Type -> Type -> Type Source #

type (KleisliFree m) :% a :: Type Source #

Methods

(%) :: KleisliFree m -> Dom (KleisliFree m) a b -> Cod (KleisliFree m) (KleisliFree m :% a) (KleisliFree m :% b) Source #

type Dom (KleisliFree m) Source # 
Instance details

Defined in Data.Category.Kleisli

type Dom (KleisliFree m) = Dom m
type Cod (KleisliFree m) Source # 
Instance details

Defined in Data.Category.Kleisli

type Cod (KleisliFree m) = Kleisli m
type (KleisliFree m) :% a Source # 
Instance details

Defined in Data.Category.Kleisli

type (KleisliFree m) :% a = a

data KleisliForget m Source #

Constructors

KleisliForget 
Instances
(Functor m, Dom m ~ k, Cod m ~ k) => Functor (KleisliForget m) Source # 
Instance details

Defined in Data.Category.Kleisli

Associated Types

type Dom (KleisliForget m) :: Type -> Type -> Type Source #

type Cod (KleisliForget m) :: Type -> Type -> Type Source #

type (KleisliForget m) :% a :: Type Source #

type Dom (KleisliForget m) Source # 
Instance details

Defined in Data.Category.Kleisli

type Cod (KleisliForget m) Source # 
Instance details

Defined in Data.Category.Kleisli

type Cod (KleisliForget m) = Dom m
type (KleisliForget m) :% a Source # 
Instance details

Defined in Data.Category.Kleisli

type (KleisliForget m) :% a = m :% a

kleisliAdj :: (Functor m, Dom m ~ k, Cod m ~ k) => Monad m -> Adjunction (Kleisli m) k (KleisliFree m) (KleisliForget m) Source #