CoT
CoT gives you the best
pairing monad transformer for any Comonad W
In other words, an explorer for the state space given by W. It can also provide:
- A MonadReader from a ComonadEnv
- A MonadWriter from a ComonadTraced
- A MonadState from a ComonadStore
-
Safe downcast.
Declaration
Swift
public static func fix(_ value: CoTOf<W, M, A>) -> CoT<W, M, A>Parameters
valueValue in the higher-kind form.
Return Value
Value cast to CoT.
-
Lifts a comonadic query into a CoT.
The original signature of this function is:
(forall s. w s -> a) -> CoT w m aDeclaration
Swift
public static func liftT(_ f: @escaping (Kind<W, Any/*S*/>) -> A) -> CoT<W, M, A>Parameters
fComonadic query.
Return Value
A CoT from the Comonadic query.
-
Explores the space of a Comonad with a given Monad.
Parameters
coMonadic actions to explore the Comonad.
waComonadic space to explore.
Return Value
A new Comonadic space resulting from the exploration.
-
Runs the inner function.
Declaration
Swift
func run<R>(_ w: Kind<W, (A) -> R>) -> RParameters
wArgument for the inner function.
Return Value
A plain value.
-
Runs the inner function with a value that does not runs on the base Monad.
Declaration
Swift
func lower<B>(_ input: Kind<W, B>) -> AParameters
inputA value in the Comonad context.
Return Value
A plain value.
Install in Dash
CoT Class Reference