Decomposition of fi.contramap(k) into its components, as it is
frequently convenient to apply k separately from sorting or
whatever process with fi, even when B is unknown, which is
very common.
This is isomorphic to F as long as F itself is a contravariant
functor. The homomorphism from F[A] to
ContravariantCoyoneda[F,A] exists even when F is not a
contravariant functor.
See ContravariantCoyonedaUsage.scala in the scalaz source tree
for an interesting usage demonstration.
As ContravariantCoyoneda(identity)(o).unlift = o, further
factoring can occur as follows, for free:
Decomposition of
fi.contramap(k)
into its components, as it is frequently convenient to applyk
separately from sorting or whatever process withfi
, even whenB
is unknown, which is very common.This is isomorphic to
F
as long asF
itself is a contravariant functor. The homomorphism fromF[A]
toContravariantCoyoneda[F,A]
exists even whenF
is not a contravariant functor.See
ContravariantCoyonedaUsage.scala
in the scalaz source tree for an interesting usage demonstration.As
ContravariantCoyoneda(identity)(o).unlift
=o
, further factoring can occur as follows, for free:http://hackage.haskell.org/package/kan-extensions-4.0.1/docs/Data-Functor-Contravariant-Coyoneda.html