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
Source:
Eff.scala
trait Serializable
trait Product
trait Equals
trait Eff[R, A]
class Object
trait Matchable
class Any

Value members

Concrete methods

def addLast(l: Last[R]): Eff[R, A]
Source:
Eff.scala
def toMonadic: Eff[R, A]
Source:
Eff.scala

Inherited methods

def *>[B](fb: Eff[R, B]): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def <*[B](fb: Eff[R, B]): Eff[R, A]
Inherited from:
Eff
Source:
Eff.scala
def <<[B](fb: Eff[R, B]): Eff[R, A]
Inherited from:
Eff
Source:
Eff.scala
def >>[B](fb: Eff[R, B]): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def >>=[B](f: A => Eff[R, B]): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def addLast(l: => Eff[R, Unit]): Eff[R, A]

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
Source:
Eff.scala
def ap[B](f: Eff[R, A => B]): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def flatMap[B](f: A => Eff[R, B]): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def flatten[B](implicit ev: A <:< Eff[R, B]): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def map[B](f: A => B): Eff[R, B]
Inherited from:
Eff
Source:
Eff.scala
def map2[B, C](fb: Eff[R, B])(f: (A, B) => C): Eff[R, C]
Inherited from:
Eff
Source:
Eff.scala
def map2Flatten[B, C](fb: Eff[R, B])(f: (A, B) => Eff[R, C]): Eff[R, C]
Inherited from:
Eff
Source:
Eff.scala
def product[B](fb: Eff[R, B]): Eff[R, (A, B)]
Inherited from:
Eff
Source:
Eff.scala
Inherited from:
Product