kan-extensions-5.2.7: Kan extensions, Kan lifts, the Yoneda lemma, and (co)density (co)monads

Copyright | (C) 2013-2016 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | GADTs, TFs, MPTCs
Safe Haskell | Trustworthy
Language | Haskell2010

Data.Functor.Contravariant.Yoneda

Description

Synopsis

- newtype Yoneda (f :: Type -> Type) a = Yoneda {
  - runYoneda :: forall r. (r -> a) -> f r
  }
- liftYoneda :: Contravariant f => f a -> Yoneda f a
- lowerYoneda :: Yoneda f a -> f a

# Documentation

newtype Yoneda (f :: Type -> Type) a Source #

Yoneda embedding for a presheaf

Constructors

Yoneda |

Fields

- runYoneda :: forall r. (r -> a) -> f r

#### Instances

Instances details

Representable f => Representable (Yoneda f) Source # |

Instance details

Defined in Data.Functor.Contravariant.Yoneda

Associated Types

type Rep (Yoneda f) |
Instance details Defined in Data.Functor.Contravariant.Yoneda type Rep (Yoneda f) = Rep f

Methods

tabulate :: (a -> Rep (Yoneda f)) -> Yoneda f a Source #

index :: Yoneda f a -> a -> Rep (Yoneda f) Source #

contramapWithRep :: (b -> Either a (Rep (Yoneda f))) -> Yoneda f a -> Yoneda f b Source #

Contravariant (Yoneda f) Source # |
Instance details Defined in Data.Functor.Contravariant.Yoneda Methods contramap :: (a' -> a) -> Yoneda f a -> Yoneda f a' Source # (>$) :: b -> Yoneda f b -> Yoneda f a Source #
Adjunction f g => Adjunction (Yoneda f) (Yoneda g) Source # |
Instance details Defined in Data.Functor.Contravariant.Yoneda Methods unit :: a -> Yoneda g (Yoneda f a) Source # counit :: a -> Yoneda f (Yoneda g a) Source # leftAdjunct :: (b -> Yoneda f a) -> a -> Yoneda g b Source # rightAdjunct :: (a -> Yoneda g b) -> b -> Yoneda f a Source #
type Rep (Yoneda f) Source # |
Instance details Defined in Data.Functor.Contravariant.Yoneda type Rep (Yoneda f) = Rep f

liftYoneda :: Contravariant f => f a -> Yoneda f a Source #

    liftYoneda . lowerYoneda ≡ id
    lowerYoneda . liftYoneda ≡ id

lowerYoneda :: Yoneda f a -> f a Source #