Package

org.specs2.control

eff

Permalink

package eff

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. eff
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type <=[M[_], R] = Member[M, R]

    Permalink
  2. case class Arrs[R, A, B](functions: Vector[(Any) ⇒ Eff[R, Any]]) extends Product with Serializable

    Permalink

    Sequence of monadic functions from A to B: A => Eff[B]

    Sequence of monadic functions from A to B: A => Eff[B]

    Internally it is represented as a Vector of functions:

    A => Eff[R, X1]; X1 => Eff[R, X2]; X2 => Eff[R, X3]; ...; X3 => Eff[R, B]

  3. type Console[A] = AnyRef { ... /* 2 definitions in type refinement */ }

    Permalink
  4. trait ConsoleEffect extends AnyRef

    Permalink
  5. trait ConsoleImplicits extends ConsoleImplicits1

    Permalink
  6. trait ConsoleImplicits1 extends AnyRef

    Permalink
  7. trait ConsoleTag extends AnyRef

    Permalink
  8. trait DisjunctionCreation extends AnyRef

    Permalink
  9. trait DisjunctionEffect extends DisjunctionCreation with DisjunctionInterpretation

    Permalink

    Effect for computation which can fail

  10. trait DisjunctionInterpretation extends AnyRef

    Permalink
  11. sealed trait Eff[R, A] extends AnyRef

    Permalink

    Effects of type R, returning a value of type A

    Effects of type R, returning a value of type A

    It is implemented as a "Free-er" monad with extensible effects:

    • the "pure" case is a pure value of type A
    • the "impure" case is:
      • a disjoint union of possible effects
      • a continuation of type X => Eff[R, A] indicating what to do if the current effect is of type M[X] this type is represented by the Arrs type

    The monad implementation for this type is really simple:

    • point is Pure
    • bind simply appends the binding function to the Arrs continuation

    Important:

    The list of continuations is NOT implemented as a type sequence but simply as a Vector[Any => Eff[R, Any]]

    This means that various .asInstanceOf are present in the implementation and could lead to burns and severe harm. Use with caution!

    See also

    http://okmij.org/ftp/Haskell/extensible/more.pdf

  12. trait EffCreation extends AnyRef

    Permalink
  13. trait EffImplicits extends AnyRef

    Permalink
  14. trait EffInterpretation extends AnyRef

    Permalink
  15. sealed trait Effect[F[_]] extends AnyRef

    Permalink

    one effect, basically a type constructor

  16. trait Effects extends AnyRef

    Permalink

    Effects is a type level representing a list of effects which might take place in a computation

    Effects is a type level representing a list of effects which might take place in a computation

    Note that each "effect" is a type constructor

  17. final case class EffectsCons[F[_], T <: Effects](head: Effect[F], tail: T) extends Effects with Product with Serializable

    Permalink

    Append an effect at the beginning of a list of effects

  18. trait ErrorCreation[F] extends ErrorTypes[F]

    Permalink
  19. trait ErrorEffect[F] extends ErrorCreation[F] with ErrorInterpretation[F]

    Permalink

    Effect for computation which can fail and return a Throwable, or just stop with a failure

    Effect for computation which can fail and return a Throwable, or just stop with a failure

    This effect is a mix of Eval and \/ in the sense that every computation passed to this effect (with the ok method) is considered "impure" or "faulty" by default.

    The type F is used to represent the failure type.

  20. trait ErrorInterpretation[F] extends ErrorCreation[F]

    Permalink
  21. trait ErrorTypes[F] extends AnyRef

    Permalink
  22. trait EvalCreation extends EvalTypes

    Permalink
  23. trait EvalEffect extends EvalTypes with EvalCreation with EvalInterpretation

    Permalink

    Effect for delayed computations

    Effect for delayed computations

    uses scalaz.Need as a supporting data structure

  24. trait EvalInterpretation extends EvalTypes

    Permalink
  25. trait EvalTypes extends AnyRef

    Permalink
  26. trait Fold[A, B] extends AnyRef

    Permalink

    support trait for folding values while possibly keeping some internal state

  27. case class Impure[R, X, A](union: Union[R, X], continuation: Arrs[R, X, A]) extends Eff[R, A] with Product with Serializable

    Permalink

    union is a disjoint union of effects returning a value of type X (not specified)

  28. trait Interpret extends AnyRef

    Permalink

    Support methods to create an interpreter (or "effect handlers") for a given Eff[M |: R, A].

    Support methods to create an interpreter (or "effect handlers") for a given Eff[M |: R, A]. The aim being to "consume" just that effect and produce a value of type B with possibly other effects: Eff[R, B]

    Those methods guarantee a stack-safe behaviour when running on a large list of effects (in a list.traverseU(f) for example).

    There are 3 different types of supported interpreters:

    1. interpret + Recurse

    This interpreter is used to handle effects which either return a value X from M[X] or stops with Eff[R, B] See an example of such an interpreter in Eval where we just evaluate a computation X for each Eval[X].

    2. interpretState + StateRecurse

    This interpreter is used to handle effects which either return a value X from M[X] or stops with Eff[R, B]

    3. interpretLoop + Loop

    The most generic kind of interpreter where we can even recurse in the case of Pure(a) (See ListEffect for such a use)

  29. trait IntoPoly[R <: Effects, U, A] extends AnyRef

    Permalink

    Trait for polymorphic recursion into Eff[?, A]

    Trait for polymorphic recursion into Eff[?, A]

    The idea is to deal with one effect at the time:

    • if the effect stack is M |: R and if U contains M we transform each "Union[R, X]" in the Impure case into a Union for U and we try to recurse on other effects present in R
    • if the effect stack is M |: NoEffect and if U contains M we just "inject" the M[X] effect into Eff[U, A] using the Member typeclass if M is not present when we decompose we throw an exception. This case should never happen because if there is no other effect in the stack there should be at least something producing a value of type A
  30. trait IntoPolyLower extends AnyRef

    Permalink
  31. trait ListCreation extends AnyRef

    Permalink
  32. trait ListEffect extends ListCreation with ListInterpretation

    Permalink

    Effect for computations possibly returning several values

  33. trait ListInterpretation extends AnyRef

    Permalink
  34. trait Member[T[_], R] extends AnyRef

    Permalink

    Member typeclass for effects belonging to a stack of effects R

    Member typeclass for effects belonging to a stack of effects R

    If T is a member of R then we can:

    - create a Union of effects from a single effect with "inject" - extract an effect value from a union if there is such an effect in the stack

    Annotations
    @implicitNotFound( ... )
  35. trait MemberImplicits extends MemberImplicits1

    Permalink
  36. trait MemberImplicits1 extends MemberImplicits2

    Permalink
  37. trait MemberImplicits2 extends AnyRef

    Permalink
  38. class NoEffect extends Effects

    Permalink

    Nil case for the list of effects

  39. trait OptionCreation extends AnyRef

    Permalink
  40. trait OptionEffect extends OptionCreation with OptionInterpretation

    Permalink

    Effect for optional computations

  41. trait OptionInterpretation extends AnyRef

    Permalink
  42. case class Pure[R, A](value: A) extends Eff[R, A] with Product with Serializable

    Permalink
  43. trait ReaderCreation extends AnyRef

    Permalink
  44. trait ReaderEffect extends ReaderCreation with ReaderInterpretation with ReaderImplicits

    Permalink

    Effect for computations depending on an environment.

    Effect for computations depending on an environment.

    The inside datatype for this effect is scalaz.Reader

    Several Reader effects can be present in a given stack provided that they are tagged with scala.Tag.

    A tagged Reader effect can be run with runTaggedReader

  45. trait ReaderImplicits extends ReaderImplicits1

    Permalink
  46. trait ReaderImplicits1 extends AnyRef

    Permalink
  47. trait ReaderInterpretation extends AnyRef

    Permalink
  48. trait StateCreation extends AnyRef

    Permalink
  49. trait StateEffect extends StateCreation with StateInterpretation with StateImplicits

    Permalink

    Effect for passing state along computations

    Effect for passing state along computations

    Several state effects can be used in the same stack if they are tagged

    Internally backed up by scalaz.State

  50. trait StateImplicits extends StateImplicits1

    Permalink
  51. trait StateImplicits1 extends AnyRef

    Permalink
  52. trait StateInterpretation extends AnyRef

    Permalink
  53. sealed trait Union[+R, A] extends AnyRef

    Permalink

    Open union of effects

    Open union of effects

    They are modelled as a list of

    UnionNext(UnionNext(...(UnionNow(M[X])))

    where M[X] is an effect. The depth of the nesting in an Union value corresponds to the place of the effect in a type E1 |: E2 |: E3 |: .. |: NoEffect

  54. case class UnionNext[O[_], R <: Effects, A](u: Union[R, A]) extends Union[eff.Effects.|:[O, R], A] with Product with Serializable

    Permalink
  55. case class UnionNow[T[_], R <: Effects, A](ta: T[A]) extends Union[eff.Effects.|:[T, R], A] with Product with Serializable

    Permalink
  56. type Warnings[A] = AnyRef { ... /* 2 definitions in type refinement */ }

    Permalink
  57. trait WarningsEffect extends AnyRef

    Permalink
  58. trait WarningsImplicits extends WarningsImplicits1

    Permalink
  59. trait WarningsImplicits1 extends AnyRef

    Permalink
  60. trait WarningsTag extends AnyRef

    Permalink
  61. trait WriterCreation extends AnyRef

    Permalink
  62. trait WriterEffect extends WriterCreation with WriterInterpretation

    Permalink

    Effect for logging values alongside computations

    Effect for logging values alongside computations

    Compared to traditional Writer monad which accumulates values by default this effect can be interpreted in different ways:

    • log values to the console or to a file as soon as they are produced
    • accumulate values in a list

    Several writer effects can be used in the same stack if they are tagged.

  63. trait WriterInterpretation extends AnyRef

    Permalink

Value Members

  1. object Arrs extends Serializable

    Permalink
  2. object ConsoleEffect extends ConsoleEffect

    Permalink
  3. object ConsoleImplicits extends ConsoleImplicits

    Permalink
  4. object DisjunctionCreation extends DisjunctionCreation

    Permalink
  5. object DisjunctionEffect extends DisjunctionEffect

    Permalink
  6. object DisjunctionInterpretation extends DisjunctionInterpretation

    Permalink
  7. object Eff extends EffCreation with EffInterpretation with EffImplicits

    Permalink
  8. object EffCreation extends EffCreation

    Permalink
  9. object EffImplicits extends EffImplicits

    Permalink
  10. object EffInterpretation extends EffInterpretation

    Permalink
  11. object Effects extends Effects

    Permalink

    Aliases for declaring effects with the following syntax

    Aliases for declaring effects with the following syntax

    A |: B |: C |: NoEffect

  12. object ErrorEffect extends ErrorEffect[String]

    Permalink

    Simple instantiation of the ErrorEffect trait with String as a Failure type

  13. object EvalEffect extends EvalEffect

    Permalink
  14. object EvalInterpretation extends EvalInterpretation

    Permalink
  15. object EvalTypes extends EvalTypes

    Permalink
  16. object Interpret extends Interpret

    Permalink
  17. object IntoPoly extends IntoPolyLower

    Permalink
  18. object ListCreation extends ListCreation

    Permalink
  19. object ListEffect extends ListEffect

    Permalink
  20. object ListInterpretation extends ListInterpretation

    Permalink
  21. object Member extends MemberImplicits

    Permalink
  22. object NoEffect extends NoEffect

    Permalink
  23. object OptionCreation extends OptionCreation

    Permalink
  24. object OptionEffect extends OptionEffect

    Permalink
  25. object OptionInterpretation extends OptionInterpretation

    Permalink
  26. object ReaderCreation extends ReaderCreation

    Permalink
  27. object ReaderEffect extends ReaderEffect

    Permalink
  28. object ReaderImplicits extends ReaderImplicits

    Permalink
  29. object ReaderInterpretation extends ReaderInterpretation

    Permalink
  30. object StateCreation extends StateCreation

    Permalink
  31. object StateEffect extends StateEffect

    Permalink
  32. object StateImplicits extends StateImplicits

    Permalink
  33. object StateInterpretation extends StateInterpretation

    Permalink
  34. object Union

    Permalink

    create union objects

  35. object WarningsEffect extends WarningsEffect

    Permalink
  36. object WarningsImplicits extends WarningsImplicits

    Permalink
  37. object WriterCreation extends WriterCreation

    Permalink
  38. object WriterEffect extends WriterEffect

    Permalink
  39. object WriterInterpretation extends WriterInterpretation

    Permalink
  40. object all extends ConsoleEffect with WarningsEffect with ReaderEffect with WriterEffect with StateEffect with EvalEffect with OptionEffect with ListEffect with DisjunctionEffect with EffInterpretation with EffCreation with EffImplicits with Effects

    Permalink
  41. object console extends ConsoleEffect with ConsoleImplicits

    Permalink
  42. object disjunction extends DisjunctionCreation with DisjunctionInterpretation

    Permalink
  43. object eff extends EffCreation with EffInterpretation with Effects

    Permalink
  44. object eval extends EvalCreation with EvalInterpretation

    Permalink
  45. object interpret extends Interpret

    Permalink
  46. object list extends ListCreation with ListInterpretation

    Permalink
  47. object option extends OptionCreation with OptionInterpretation

    Permalink
  48. object reader extends ReaderCreation with ReaderInterpretation

    Permalink
  49. object state extends StateCreation with StateInterpretation

    Permalink
  50. package syntax

    Permalink
  51. object warnings extends WarningsEffect with WarningsImplicits

    Permalink
  52. object writer extends WriterCreation with WriterInterpretation

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped