-
Safe downcast.
Declaration
Swift
public static func fix(_ fa: EitherKOf<F, G, A>) -> EitherK<F, G, A>
Parameters
fa
Value in the higher-kind form.
Return Value
Value cast to EitherK.
-
Initializes a EitherK from a value of the left type.
Declaration
Swift
public init(_ fa: Kind<F, A>)
Parameters
fa
Value of the left type.
-
Initializes a EitherK from a value of the right type.
Declaration
Swift
public init(_ ga: Kind<G, A>)
Parameters
ga
Value of the right type.
-
Applies the provided
FunctionK
based on the content of thisEitherK
value.Parameters
f
Function to apply if the contained value in this
EitherK
is a member of the left type.g
Function to apply if the contained value in this
EitherK
is a member of the right type.Return Value
Result of applying the corresponding function to this value.
-
Provides a Fold based on the Foldable instance of this type.
Declaration
Swift
static var fold: Fold<EitherK<F, G, A>, A> { get }
-
Provides a Traversal based on the Traverse instance of this type.
Declaration
Swift
static var traversal: Traversal<EitherK<F, G, A>, A> { get }
-
Undocumented
Declaration
Swift
public typealias EachFoci = A
-
Declaration
Swift
public static var each: Traversal<EitherK<F, G, A>, A> { get }
-
Creates a left value with the provided value.
Declaration
Swift
public static func left(_ a: A) -> EitherK<F, G, A>
Parameters
a
Value to be wrapped in the left side.
Return Value
An EitherK with the provided value on the left side.
-
Creates a right value with the provided value.
Declaration
Swift
public static func right(_ a: A) -> EitherK<F, G, A>
Parameters
a
Value to be wrapped in the right side.
Return Value
An EitherK with the provided value on the right side.