Program
public final class Program<F, A> : ProgramOf<F, A>
Program is a type that, given any type constructor, is able to provide a Monad instance, that can be interpreted into a more restrictive one.
As opposed to Free
, Program
does not require F
to be a functor, which means that evaluation of map
calls are deferred
and left for the later interpretation in another monad.
-
Internal representation of
Program
Declaration
Swift
public let asFree: Free<CoyonedaPartial<F>, A>
-
Initializes a
Program
instance from the correspondingFree<CoyonedaPartial<F>>
.Declaration
Swift
public init(asFree: Free<CoyonedaPartial<F>, A>)
-
Safe downcast.
Declaration
Swift
public static func fix(_ fa: ProgramOf<F, A>) -> Program<F, A>
Parameters
fa
Value in the higher-kind form.
Return Value
Value cast to
Program
. -
Lifts a value in the context of
F
into theProgram
context.Declaration
Swift
public static func liftF(_ fa: Kind<F, A>) -> Program<F, A>
Parameters
fa
A value in the context of
F
.Return Value
A
Program
value.