Exists
public final class Exists<F>
Encodes the notion of existential type. Exists<F>
is a wrapper around a Kind<F, X>
value, where X
is some type that is not exposed on Exists
signature.
You provide a value of type Kind<F, X>
when constructing an Exists<F>
instance but the specific type X
that you provide is hidden inside Exists
.
The only way to interact with the content of Exists<F>
is with a function of type Kind<F, X> -> R
that is polymorphic on X
(represented by the CokleisliK<F, R
class).
You pass a CokleisliK<F, R>
to an Exists<F>
and the function is called with the specific type that is hidden inside the Exists
.
This is done with the run
method.
-
Construct and
Exists
from a value of typeKind<F, A>
and hide it’s type parameterA
.Declaration
Swift
public init<A>(_ fa: Kind<F, A>)
-
Process the contents of this
Exists
with a function of typeKind<F, X> -> R
that is polymorphic onX
.Declaration
Swift
public func run<R>(_ f: CokleisliK<F, R>) -> R
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var debugDescription: String { get }