data-category-0.7.1: Category theory

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

Data.Category.Yoneda

Description

 
Synopsis

Documentation

type YonedaEmbedding k = Postcompose (Hom k) (Op k) :.: (Postcompose (Swap k (Op k)) (Op k) :.: Tuple k (Op k)) Source #

yonedaEmbedding :: Category k => YonedaEmbedding k Source #

The Yoneda embedding functor, C -> Set^(C^op).

data Yoneda (k :: * -> * -> *) f Source #

Constructors

Yoneda 
Instances
(Category k, Functor f, Dom f ~ Op k, Cod f ~ ((->) :: Type -> Type -> Type)) => Functor (Yoneda k f) Source #

Yoneda converts a functor f into a natural transformation from the hom functor to f.

Instance details

Defined in Data.Category.Yoneda

Associated Types

type Dom (Yoneda k f) :: Type -> Type -> Type Source #

type Cod (Yoneda k f) :: Type -> Type -> Type Source #

type (Yoneda k f) :% a :: Type Source #

Methods

(%) :: Yoneda k f -> Dom (Yoneda k f) a b -> Cod (Yoneda k f) (Yoneda k f :% a) (Yoneda k f :% b) Source #

type Dom (Yoneda k f) Source # 
Instance details

Defined in Data.Category.Yoneda

type Dom (Yoneda k f) = Op k
type Cod (Yoneda k f) Source # 
Instance details

Defined in Data.Category.Yoneda

type Cod (Yoneda k f) = ((->) :: Type -> Type -> Type)
type (Yoneda k f) :% a Source # 
Instance details

Defined in Data.Category.Yoneda

type (Yoneda k f) :% a = Nat (Op k) ((->) :: Type -> Type -> Type) (k :-*: a) f

fromYoneda :: (Category k, Functor f, Dom f ~ Op k, Cod f ~ (->)) => f -> Nat (Op k) (->) (Yoneda k f) f Source #

fromYoneda and toYoneda are together the isomophism from the Yoneda lemma.

toYoneda :: (Category k, Functor f, Dom f ~ Op k, Cod f ~ (->)) => f -> Nat (Op k) (->) f (Yoneda k f) Source #