Yoneda
This type implements the covariant form of the Yoneda lemma, stating that F is naturally isomorphic to Yoneda
Yoneda can be viewed as the partial application of the map function, where the first argument is fixed:
map :: (F<A>, (A) -> B) -> F<B>
Yoneda :: ((A) -> B) -> F<B>
-
Safe downcast.
Declaration
Swift
public static func fix(_ fa: YonedaOf<F, A>) -> Yoneda<F, A>Parameters
faValue in the higher-kind form.
Return Value
Value cast to Yoneda.
-
Lifts a value to a Yoneda value.
Declaration
Swift
public static func liftYoneda(_ fa: Kind<F, A>) -> Yoneda<F, A>Parameters
faFunctorial value.
Return Value
Yoneda value.
-
Initializes a Yoneda value.
Declaration
Swift
public init(_ f: @escaping (@escaping (A) -> /*B*/Any) -> Kind<F, /*B*/Any>)Parameters
fFunction describing the natural isomorphism.
-
Undocumented
Declaration
Swift
public func toCoyoneda() -> Coyoneda<F, A> -
Applies a function to this Yoneda value.
Declaration
Swift
public func apply<B>(_ f: @escaping (A) -> B) -> Kind<F, B>Parameters
fTransforming function.
Return Value
A value in the functorial context wrapped in this Yoneda value.
-
Obtains the value yielding the Yoneda isomorphism.
Declaration
Swift
public func lower() -> Kind<F, A>Return Value
A value in the functorial context.
Install in Dash
Yoneda Class Reference