Object/Trait

org.specs2.codata

Process

Related Docs: trait Process | package codata

Permalink

object Process extends ProcessInstances

Linear Supertypes
ProcessInstances, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Process
  2. ProcessInstances
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Append[+F[_], +O](head: HaltEmitOrAwait[F, O], stack: Vector[(Cause) ⇒ Trampoline[Process[F, O]]]) extends Process[F, O] with Product with Serializable

    Permalink

    The Append constructor instructs the driver to continue with evaluation of first step found in tail Vector.

    The Append constructor instructs the driver to continue with evaluation of first step found in tail Vector.

    Instead of this constructor please use:

    Process.append

  2. case class Await[+F[_], A, +O](req: F[A], rcv: (\/[EarlyCause, A]) ⇒ Trampoline[Process[F, O]], preempt: (A) ⇒ Trampoline[Process[F, Nothing]] = ...) extends HaltEmitOrAwait[F, O] with EmitOrAwait[F, O] with Product with Serializable

    Permalink

    The Await constructor instructs the driver to evaluate req.

    The Await constructor instructs the driver to evaluate req. If it returns successfully, recv is called with result on right side to transition to the next state.

    In case the req terminates with failure the Error(failure) is passed on left side giving chance for any fallback action.

    In case the process was killed before the request is evaluated Kill is passed on left side. Kill is passed on left side as well as when the request is already in progress, but process was killed.

    The preempt parameter is used when constructing resource and preemption safe cleanups. See Process.bracket for more.

    Note that

    Instead of this constructor directly, please use:

    Process.await or Process.bracket

  3. case class Cont[+F[_], +O](stack: Vector[(Cause) ⇒ Trampoline[Process[F, O]]]) extends Product with Serializable

    Permalink

    Continuation of the process.

    Continuation of the process. Represents process _stack_. Used in conjunction with Step.

  4. case class Emit[+O](seq: Seq[O]) extends HaltEmitOrAwait[Nothing, O] with EmitOrAwait[Nothing, O] with Product with Serializable

    Permalink

    The Emit constructor instructs the driver to emit the given sequence of values to the output and then halt execution with supplied reason.

    The Emit constructor instructs the driver to emit the given sequence of values to the output and then halt execution with supplied reason.

    Instead calling this constructor directly, please use one of the following helpers:

    Process.emit Process.emitAll

  5. sealed trait EmitOrAwait[+F[_], +O] extends Process[F, O]

    Permalink

    Marker trait representing process in Emit or Await state.

    Marker trait representing process in Emit or Await state. Is useful for more type safety.

  6. case class Env[-I, -I2]() extends Product with Serializable

    Permalink
  7. implicit final class EvalProcess[F[_], O] extends AnyVal

    Permalink

    Provides infix syntax for eval: Process[F,F[O]] => Process[F,O]

  8. case class Halt(cause: Cause) extends HaltEmitOrAwait[Nothing, Nothing] with HaltOrStep[Nothing, Nothing] with Product with Serializable

    Permalink

    The Halt constructor instructs the driver that the last evaluation of Process completed with supplied cause.

  9. sealed trait HaltEmitOrAwait[+F[_], +O] extends Process[F, O]

    Permalink

    Tags a state of process that has no appended tail, tha means can be Halt, Emit or Await

  10. sealed trait HaltOrStep[+F[_], +O] extends AnyRef

    Permalink

    Marker trait representing next step of process or terminated process in Halt

  11. implicit final class Process0Syntax[O] extends AnyVal

    Permalink

    This class provides infix syntax specific to Process0.

  12. implicit final class ProcessSyntax[F[_], O] extends AnyVal

    Permalink
  13. implicit class SourceSyntax[O] extends WyeOps[O]

    Permalink

    Syntax for processes that have its effects wrapped in Task

  14. case class Step[+F[_], +O](head: EmitOrAwait[F, O], next: Cont[F, O]) extends HaltOrStep[F, O] with Product with Serializable

    Permalink

    Intermediate step of process.

    Intermediate step of process. Used to step within the process to define complex combinators.

  15. type Trampoline[+A] = Free[Function0, A]

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def Both[I, I2]: Y[ReceiveY[I, I2]]

    Permalink
  5. object Cont extends Serializable

    Permalink
  6. def Get[I]: Is[I]

    Permalink
  7. object HaltEmitOrAwait

    Permalink
  8. def L[I]: Is[I]

    Permalink
  9. def R[I2]: T[I2]

    Permalink
  10. val Trampoline: scalaz.Trampoline.type

    Permalink
  11. def apply[O](o: O*): Process0[O]

    Permalink

    Alias for emitAll

  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def await[F[_], A, O](req: F[A])(rcv: (A) ⇒ Process[F, O]): Process[F, O]

    Permalink

    Await the given F request and use its result.

    Await the given F request and use its result. If you need to specify fallback, use awaitOr

  14. def await1[I]: Process1[I, I]

    Permalink

    The Process1 which awaits a single input, emits it, then halts normally.

  15. def await1Or[I](fb: ⇒ Process1[I, I]): Process1[I, I]

    Permalink

    Like await1, but consults fb when await fails to receive an I

  16. def await1W[A]: Writer1[Nothing, A, A]

    Permalink

    Writer based version of await1.

  17. def awaitBoth[I, I2]: Wye[I, I2, ReceiveY[I, I2]]

    Permalink

    The Wye which request from both branches concurrently.

  18. def awaitBothW[I, I2]: WyeW[Nothing, I, I2, ReceiveY[I, I2]]

    Permalink

    Writer based version of awaitBoth.

  19. def awaitL[I]: Tee[I, Any, I]

    Permalink

    The Tee which requests from the left branch, emits this value, then halts.

  20. def awaitLW[I]: TeeW[Nothing, I, Any, I]

    Permalink

    Writer based version of awaitL.

  21. def awaitOr[F[_], A, O](req: F[A])(fb: (EarlyCause) ⇒ Process[F, O])(rcv: (A) ⇒ Process[F, O]): Process[F, O]

    Permalink

    Await a request, and if it fails, use fb to determine the next state.

    Await a request, and if it fails, use fb to determine the next state. Otherwise, use rcv to determine the next state.

  22. def awaitR[I2]: Tee[Any, I2, I2]

    Permalink

    The Tee which requests from the right branch, emits this value, then halts.

  23. def awaitRW[I2]: TeeW[Nothing, Any, I2, I2]

    Permalink

    Writer based version of awaitR.

  24. def bracket[F[_], A, O](req: F[A])(release: (A) ⇒ Process[F, Nothing])(rcv: (A) ⇒ Process[F, O]): Process[F, O]

    Permalink

    Resource and preemption safe await constructor.

    Resource and preemption safe await constructor.

    Use this combinator, when acquiring resources. This build a process that when run evaluates req, and then runs rcv. Once rcv is completed, fails, or is interrupted, it will run release

    When the acquisition (req) is interrupted, neither release or rcv is run, however when the req was interrupted after resource in req was acquired then, the release is run.

    If,the acquisition fails, use bracket(req)(onPreempt)(rcv).onFailure(err => ???) code to recover from the failure eventually.

  25. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def constant[A](a: A, chunkSize: Int = 1): Process0[A]

    Permalink

    The infinite Process, always emits a.

    The infinite Process, always emits a. If for performance reasons it is good to emit a in chunks, specify size of chunk by chunkSize parameter

  27. def emit[O](o: O): Process0[O]

    Permalink

    The Process which emits the single value given, then halts.

  28. def emitAll[O](os: Seq[O]): Process0[O]

    Permalink

    The Process which emits the given sequence of values, then halts.

  29. def emitO[O](o: O): Process0[\/[Nothing, O]]

    Permalink

    A Writer which emits one value to the output.

  30. def emitW[W](s: W): Process0[\/[W, Nothing]]

    Permalink

    A Writer which writes the given value.

  31. def empty[F[_], O]: Process[F, O]

    Permalink

    Alias for halt.

  32. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  34. def eval[F[_], O](fo: F[O]): Process[F, O]

    Permalink

    Alias for await(fo)(emit)

  35. def eval_[F[_], O](f: F[O]): Process[F, Nothing]

    Permalink

    Evaluate an arbitrary effect once, purely for its effects, ignoring its return value.

    Evaluate an arbitrary effect once, purely for its effects, ignoring its return value. This Process emits no values.

  36. def fail(rsn: Throwable): Process0[Nothing]

    Permalink

    The Process which emits no values and halts immediately with the given exception.

  37. def fill[A](n: Int)(a: A, chunkSize: Int = 1): Process0[A]

    Permalink

    A Process which emits n repetitions of a.

  38. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  39. def forwardFill[A](p: Process[Task, A])(implicit S: Strategy): Process[Task, A]

    Permalink

    Produce a continuous stream from a discrete stream by using the most recent value.

  40. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  41. val halt: Process0[Nothing]

    Permalink

    The Process which emits no values and signals normal termination.

  42. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  44. def iterate[A](start: A)(f: (A) ⇒ A): Process0[A]

    Permalink

    An infinite Process that repeatedly applies a given function to a start value.

    An infinite Process that repeatedly applies a given function to a start value. start is the first value emitted, followed by f(start), then f(f(start)), and so on.

  45. def iterateEval[F[_], A](start: A)(f: (A) ⇒ F[A]): Process[F, A]

    Permalink

    Like iterate, but takes an effectful function for producing the next state.

    Like iterate, but takes an effectful function for producing the next state. start is the first value emitted.

  46. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  47. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  48. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  49. implicit val process1Choice: Choice[Process1]

    Permalink
    Definition Classes
    ProcessInstances
  50. implicit def process1Contravariant[O]: Contravariant[[α]Process[Is, O]]

    Permalink
    Definition Classes
    ProcessInstances
  51. implicit val process1Profunctor: Profunctor[Process1]

    Permalink
    Definition Classes
    ProcessInstances
  52. implicit val processHoist: Hoist[Process]

    Permalink
    Definition Classes
    ProcessInstances
  53. implicit def processMonadPlus[F[_]]: MonadPlus[[α]Process[F, α]]

    Permalink
    Definition Classes
    ProcessInstances
  54. def range(start: Int, stopExclusive: Int, by: Int = 1): Process0[Int]

    Permalink

    Lazily produce the range [start, stopExclusive).

    Lazily produce the range [start, stopExclusive). If you want to produce the sequence in one chunk, instead of lazily, use emitAll(start until stopExclusive).

  55. def ranges(start: Int, stopExclusive: Int, size: Int): Process0[(Int, Int)]

    Permalink

    Lazily produce a sequence of nonoverlapping ranges, where each range contains size integers, assuming the upper bound is exclusive.

    Lazily produce a sequence of nonoverlapping ranges, where each range contains size integers, assuming the upper bound is exclusive. Example: ranges(0, 1000, 10) results in the pairs (0, 10), (10, 20), (20, 30) ... (990, 1000)

    Note: The last emitted range may be truncated at stopExclusive. For instance, ranges(0,5,4) results in (0,4), (4,5).

    Exceptions thrown

    IllegalArgumentException if size <= 0

  56. def receive1[I, O](rcv: (I) ⇒ Process1[I, O]): Process1[I, O]

    Permalink

    The Process1 which awaits a single input and passes it to rcv to determine the next state.

  57. def receive1Or[I, O](fb: ⇒ Process1[I, O])(rcv: (I) ⇒ Process1[I, O]): Process1[I, O]

    Permalink

    Like receive1, but consults fb when it fails to receive an input.

  58. def repeat[F[_], O](p: Process[F, O]): Process[F, O]

    Permalink

    Prefix syntax for p.repeat.

  59. def repeatEval[F[_], O](fo: F[O]): Process[F, O]

    Permalink

    Evaluate an arbitrary effect in a Process.

    Evaluate an arbitrary effect in a Process. The resulting Process will emit values until an error occurs.

  60. def sleepUntil[F[_], A](awaken: Process[F, Boolean])(p: Process[F, A]): Process[F, A]

    Permalink

    Delay running p until awaken becomes true for the first time.

    Delay running p until awaken becomes true for the first time. The awaken process may be discrete.

  61. def supply(initial: Long): Process[Task, Long]

    Permalink

    A supply of Long values, starting with initial.

    A supply of Long values, starting with initial. Each read is guaranteed to return a value which is unique across all threads reading from this supply.

  62. def suspend[F[_], O](p: ⇒ Process[F, O]): Process[F, O]

    Permalink

    Produce p lazily.

    Produce p lazily. Useful if producing the process involves allocation of some local mutable resource we want to ensure is freshly allocated for each consumer of p.

    Note that this implementation assures that:

    suspend(p).kill === suspend(p.kill)
    suspend(p).kill === p.kill
    
    suspend(p).repeat === suspend(p.repeat)
    suspend(p).repeat ===  p.repeat
    
    suspend(p).eval === suspend(p.eval)
    suspend(p).eval === p.eval
    
    Halt(cause) ++ suspend(p) === Halt(cause) ++ p
  63. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  64. def tell[S](s: S): Process0[\/[S, Nothing]]

    Permalink

    A Writer which writes the given value; alias for emitW.

  65. implicit def toChannelSyntax[F[_], I, O](self: Channel[F, I, O]): ChannelSyntax[F, I, O]

    Permalink

    Adds syntax for Channel.

  66. implicit def toProcess1Syntax[I, O](self: Process1[I, O]): Process1Syntax[I, O]

    Permalink

    Adds syntax for Process1.

  67. implicit def toSinkSyntax[F[_], I](self: Sink[F, I]): SinkSyntax[F, I]

    Permalink

    Adds syntax for Sink.

  68. implicit def toSinkTaskSyntax[F[_], I](self: Sink[Task, I]): SinkTaskSyntax[I]

    Permalink

    Adds syntax for Sink that is specialized for Task.

  69. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  70. implicit def toTeeSyntax[I, I2, O](self: Tee[I, I2, O]): TeeSyntax[I, I2, O]

    Permalink

    Adds syntax for Tee.

  71. implicit def toWriterSyntax[F[_], W, O](self: Writer[F, W, O]): WriterSyntax[F, W, O]

    Permalink

    Adds syntax for Writer.

  72. implicit def toWriterTaskSyntax[W, O](self: Writer[Task, W, O]): WriterTaskSyntax[W, O]

    Permalink

    Adds syntax for Writer that is specialized for Task.

  73. implicit def toWyeSyntax[I, I2, O](self: Wye[I, I2, O]): WyeSyntax[I, I2, O]

    Permalink

    Adds syntax for Wye.

  74. def unfold[S, A](s0: S)(f: (S) ⇒ Option[(A, S)]): Process0[A]

    Permalink

    Produce a (potentially infinite) source from an unfold.

  75. def unfoldEval[F[_], S, A](s0: S)(f: (S) ⇒ F[Option[(A, S)]]): Process[F, A]

    Permalink

    Like unfold, but takes an effectful function.

  76. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ProcessInstances

Inherited from AnyRef

Inherited from Any

Ungrouped