Coyoneda
public final class Coyoneda<F, A> : CoyonedaOf<F, A>
This type implements the dual version of the Yoneda lemma, stating that F is naturally isomorphic to Coyoneda
Coyoneda can be viewed as the arguments that we need for the map
function.
-
Initializes a Coyoneda value.
Declaration
Swift
public convenience init<P>(pivot: Kind<F, P>, f: @escaping (P) -> A)
Parameters
pivot
A value in the context of
F
.function
A function transforming the type parameter into a new type.
-
Safe downcast.
Declaration
Swift
public static func fix(_ fa: CoyonedaOf<F, A>) -> Coyoneda<F, A>
Parameters
fa
Value in higher-kind form.
Return Value
Value cast to Coyoneda.
-
Lifts a value in the F context into a Coyoneda.
Declaration
Swift
public static func liftCoyoneda(_ fa: Kind<F, A>) -> Coyoneda<F, A>
Parameters
fa
Value in the F context.
Return Value
A Coyoneda value.