Data.Functor.Contravariant.Yoneda

kan-extensions-5.0.1: Kan extensions, Kan lifts, various forms of 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 | Haskell98

Data.Functor.Contravariant.Yoneda

Description

Synopsis

- newtype Yoneda f 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 a

Yoneda embedding for a presheaf

Constructors

Yoneda |
Fields runYoneda :: forall r. (r -> a) -> f r

Instances

Contravariant (Yoneda f) |
Representable f => Representable (Yoneda f) |
Adjunction f g => Adjunction (Yoneda f) (Yoneda g) |
type Rep (Yoneda f) = Rep f |

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

    liftYoneda . lowerYoneda ≡ id
    lowerYoneda . liftYoneda ≡ id

lowerYoneda :: Yoneda f a -> f a