Yoneda

abstract
class Yoneda[F[_], A]

The cofree functor generated by F. The Yoneda lemma says that Yoneda[F,A] is isomorphic to F[A] for any functor F. The homomorphism from Yoneda[F,A] to F[A] exists even when we have forgotten that F is a functor. Can be seen as a partially applied map for the functor F.

Companion
object
class Object
trait Matchable
class Any
Yoneda[F, A]

Value members

Abstract methods

def apply[B](f: A => B): F[B]

Concrete methods

def extend[G[_] : Functor](f: NaturalTransformation[[_] =>> Yoneda[F, _$3], G]): Yoneda[G, A]

Yoneda is a comonad in an endofunctor category

Yoneda is a comonad in an endofunctor category

def flatMap[G[_]](f: NaturalTransformation[F, [_] =>> Yoneda[G, _$5]]): Yoneda[G, A]

Yoneda is a monad in an endofunctor category

Yoneda is a monad in an endofunctor category

def map[B](f: A => B): Yoneda[F, B]

Simple function composition. Allows map fusion without traversing an F.

Simple function composition. Allows map fusion without traversing an F.

def run: F[A]

Converts to F[A] even without a Functor instance for F

Converts to F[A] even without a Functor instance for F

def toCoyoneda: Aux[F, A, A]

Converts to Coyoneda[F,A] even without a Functor instance for F

Converts to Coyoneda[F,A] even without a Functor instance for F

def toRan: Ran[Id, F, A]

Yoneda[F, _] is the right Kan extension of F along Id

Yoneda[F, _] is the right Kan extension of F along Id