ImpureAp
case
class ImpureAp[R, X, A](unions: Unions[R, X], continuation: Continuation[R, Vector[Any], A], last: Last[R]) extends Eff[R, A]
ImpureAp is a list of independent effects and a pure function creating a value with all the resulting values once all effects have been interpreted.
This essentially models a sequence + map operation but it is important to understand that the list of
Union objects can represent different effects and be like: Vector[Option[Int], Future[String], Option[Int]]
.
Interpreting such an Eff value for a given effect (say Option) consists in:
- grouping all the Option values,
- sequencing them
- pass them to a continuation which will apply the 'map' functions when the other effects (Future in the example above) will have been interpreted
VERY IMPORTANT:
- this object is highly unsafe
- the size of the list argument to 'map' must always be equal to the number of unions in the Unions object
- the types of the elements in the list argument to 'map' must be the exact types of each effect in unions.unions
Value members
Inherited methods
add one last action to be executed after any computation chained to this Eff value
add one last action to be executed after any computation chained to this Eff value
- Inherited from
- Eff