-
Wrapped
Maybevalue.Declaration
Swift
public let value: Maybe<A> -
Safe downcast.
Declaration
Swift
public static func fix(_ value: MaybeKOf<A>) -> MaybeK<A>Parameters
valueValue in the higher-kind form.
Return Value
Value cast to MaybeK.
-
Provides an empty
MaybeK.Declaration
Swift
public static func empty() -> MaybeK<A>Return Value
A
MaybeKthat does not provide any value. -
Creates a
MaybeKfrom the result of evaluating a function, suspending its execution.Declaration
Swift
public static func from(_ f: @escaping () throws -> A) -> MaybeK<A>Parameters
fFunction providing the value to be provided in the underlying
Maybe.Return Value
A
MaybeKthat provides the value obtained from the closure. -
Creates a
MaybeKfrom the result of evaluating a function, suspending its execution.Declaration
Swift
public static func invoke(_ f: @escaping () throws -> MaybeKOf<A>) -> MaybeK<A>Parameters
fFunction providing the value to be provided by the underlying
Maybe.Return Value
A
MaybeKthat provides the value obtained from the closure. -
Initializes a value of this type with the underlying
Maybevalue.Declaration
Swift
public init(_ value: Maybe<A>)Parameters
valueWrapped
Maybevalue. -
Performs an action based on the result of the execution of the underlying
Maybe.Declaration
Swift
public func fold<B>(_ ifEmpty: @escaping () -> B, _ ifSome: @escaping (A) -> B) -> BParameters
ifEmptyAction to be performed if the underlying
Maybeis empty.ifSomeAction to be perfomed if the underlying
Maybehas a value.Return Value
Result of performing either operation.
Install in Dash
MaybeK Class Reference