scalaz.stream

process1

object process1

Source
process1.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. process1
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Await1

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def awaitOption[I]: Process1[I, Option[I]]

    Await a single value, returning None if the input has been exhausted.

  9. def buffer[I](n: Int): Process1[I, I]

    Behaves like the identity process, but requests n elements at a time from its input.

  10. def bufferAll[I]: Process1[I, I]

    Behaves like the identity process, but batches all output into a single Emit.

  11. def bufferBy[I](f: (I) ⇒ Boolean): Process1[I, I]

    Behaves like the identity process, but requests elements from its input in blocks that end whenever the predicate switches from true to false.

  12. def chunk[I](n: Int): Process1[I, Vector[I]]

    Groups inputs into chunks of size n.

    Groups inputs into chunks of size n. The last chunk may have size less than n, depending on the number of elements in the input.

    Example:
    1. scala> Process(1, 2, 3, 4, 5).chunk(2).toList
      res0: List[Vector[Int]] = List(Vector(1, 2), Vector(3, 4), Vector(5))
    Exceptions thrown
    IllegalArgumentException

    if n <= 0

  13. def chunkAll[I]: Process1[I, Vector[I]]

    Collects up all output of this Process1 into a single Emit.

  14. def chunkBy[I](f: (I) ⇒ Boolean): Process1[I, Vector[I]]

    Like chunk, but emits a chunk whenever the predicate switches from true to false.

    Like chunk, but emits a chunk whenever the predicate switches from true to false.

    scala> Process(1, 2, -1, 3, 4).chunkBy(_ > 0).toList
    res0: List[Vector[Int]] = List(Vector(1, 2, -1), Vector(3, 4))
  15. def chunkBy2[I](f: (I, I) ⇒ Boolean): Process1[I, Vector[I]]

    Like chunkBy, but the predicate depends on the current and previous elements.

  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def collect[I, I2](pf: PartialFunction[I, I2]): Process1[I, I2]

    Like collect on scala collection.

    Like collect on scala collection. Builds a new process by applying a partial function to all elements of this process on which the function is defined.

    Elements, for which the partial function is not defined are filtered out from new process

  18. def collectFirst[I, I2](pf: PartialFunction[I, I2]): Process1[I, I2]

    Like collect, but emits only the first element of this process on which the partial function is defined.

  19. def delete[I](f: (I) ⇒ Boolean): Process1[I, I]

    Skips the first element that matches the predicate.

    Skips the first element that matches the predicate.

    Example:
    1. scala> Process(3, 4, 5, 6).delete(_ % 2 == 0).toList
      res0: List[Int] = List(3, 5, 6)
  20. def distinctConsecutive[A](implicit arg0: Equal[A]): Process1[A, A]

    Emits only elements that are distinct from their immediate predecessors.

    Emits only elements that are distinct from their immediate predecessors.

    Example:
    1. scala> import scalaz.std.anyVal._
      scala> Process(1, 2, 2, 1, 1, 3).distinctConsecutive.toList
      res0: List[Int] = List(1, 2, 1, 3)
  21. def distinctConsecutiveBy[A, B](f: (A) ⇒ B)(implicit arg0: Equal[B]): Process1[A, A]

    Emits only elements that are distinct from their immediate predecessors according to f.

    Emits only elements that are distinct from their immediate predecessors according to f.

    Example:
    1. scala> import scalaz.std.anyVal._
      scala> Process("a", "ab", "bc", "c", "d").distinctConsecutiveBy(_.length).toList
      res0: List[String] = List(a, ab, c)
  22. def drainLeading[A, B](p: Process1[A, B]): Process1[A, B]

    Remove any leading emitted values that occur before the first successful Await.

    Remove any leading emitted values that occur before the first successful Await. That means that the returned Process1 will produce output only if it has consumed at least one input element.

  23. def drop[I](n: Int): Process1[I, I]

    Skips the first n elements of the input, then passes through the rest.

  24. def dropLast[I]: Process1[I, I]

    Emits all but the last element of the input.

  25. def dropLastIf[I](p: (I) ⇒ Boolean): Process1[I, I]

    Emits all elements of the input but skips the last if the predicate is true.

  26. def dropRight[I](n: Int): Process1[I, I]

    Emits all but the last n elements of the input.

  27. def dropWhile[I](f: (I) ⇒ Boolean): Process1[I, I]

    Skips elements of the input while the predicate is true, then passes through the remaining inputs.

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

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

    Definition Classes
    AnyRef → Any
  30. def exists[I](f: (I) ⇒ Boolean): Process1[I, Boolean]

    Halts with true as soon as a matching element is received.

    Halts with true as soon as a matching element is received. Emits a single false if no input matches the predicate.

  31. def feed[I, O](i: Seq[I])(p: Process1[I, O]): Process1[I, O]

    Feed a sequence of inputs to a Process1.

  32. def feed1[I, O](i: I)(p: Process1[I, O]): Process1[I, O]

    Feed a single input to a Process1.

  33. def filter[I](f: (I) ⇒ Boolean): Process1[I, I]

    Skips any elements of the input not matching the predicate.

  34. def filterBy2[I](f: (I, I) ⇒ Boolean): Process1[I, I]

    Like filter, but the predicate f depends on the previously emitted and current elements.

    Like filter, but the predicate f depends on the previously emitted and current elements.

    Example:
    1. scala> Process(2, 4, 1, 5, 3).filterBy2(_ < _).toList
      res0: List[Int] = List(2, 4, 5)
  35. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  36. def find[I](f: (I) ⇒ Boolean): Process1[I, I]

    Skips any elements not satisfying predicate and when found, will emit that element and terminate

  37. def fold[A, B](z: B)(f: (B, A) ⇒ B): Process1[A, B]

    Process1 form of List.fold.

    Process1 form of List.fold. Folds the elements of this Process using the specified associative binary operator.

    Unlike List.fold the order is always from the left side, i.e. it will always honor order of A.

    If Process of A is empty, it will just emit z and terminate

    scala> Process(1, 2, 3, 4).fold(0)(_ + _).toList
    res0: List[Int] = List(10)
  38. def fold1[A](f: (A, A) ⇒ A): Process1[A, A]

    Alias for reduce(f).

  39. def fold1Map[A, B](f: (A) ⇒ B)(implicit M: Monoid[B]): Process1[A, B]

    Alias for reduceMap(f)(M).

  40. def fold1Monoid[A](implicit M: Monoid[A]): Process1[A, A]

    Alias for reduceSemigroup(M).

  41. def foldMap[A, B](f: (A) ⇒ B)(implicit M: Monoid[B]): Process1[A, B]

    Like fold only uses f to map A to B and uses Monoid M for associative operation

  42. def foldMonoid[A](implicit M: Monoid[A]): Process1[A, A]

    Like fold but uses Monoid for folding operation

  43. def foldSemigroup[A](implicit M: Semigroup[A]): Process1[A, A]

    Alias for reduceSemigroup(M).

  44. def forall[I](f: (I) ⇒ Boolean): Process1[I, Boolean]

    Emits a single true value if all input matches the predicate.

    Emits a single true value if all input matches the predicate. Halts with false as soon as a non-matching element is received.

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

    Definition Classes
    AnyRef → Any
  46. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  47. def id[I]: Process1[I, I]

    Repeatedly echo the input; satisfies x |> id == x and id |> x == x.

  48. def intersperse[A](separator: A): Process1[A, A]

    Adds separator between elements of the input.

    Adds separator between elements of the input. For example,

    scala> Process(1, 2, 3).intersperse(0).toList
    res0: List[Int] = List(1, 0, 2, 0, 3)
  49. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  50. def last[I]: Process1[I, I]

    Skips all but the last element of the input.

  51. def lastOr[I](li: ⇒ I): Process1[I, I]

    Skips all but the last element of the input.

    Skips all but the last element of the input. This Process will always emit exactly one value; If the input is empty, li is emitted.

  52. def lift[I, O](f: (I) ⇒ O): Process1[I, O]

    Transform the input using the given function, f.

  53. def liftFirst[A, B, C](f: (B) ⇒ Option[C])(p: Process1[A, B]): Process1[(A, C), (B, C)]

    Transform p to operate on the first element of a pair, passing through the right value with no modifications.

    Transform p to operate on the first element of a pair, passing through the right value with no modifications. Note that this halts whenever p halts.

    f

    function used to convert Bs generated during cleanup of p to pairs

  54. def liftL[A, B, C](p: Process1[A, B]): Process1[\/[A, C], \/[B, C]]

    Transform p to operate on the left hand side of an \/, passing through any values it receives on the right.

    Transform p to operate on the left hand side of an \/, passing through any values it receives on the right. Note that this halts whenever p halts.

  55. def liftR[A, B, C](p: Process1[B, C]): Process1[\/[A, B], \/[A, C]]

    Transform p to operate on the right hand side of an \/, passing through any values it receives on the left.

    Transform p to operate on the right hand side of an \/, passing through any values it receives on the left. Note that this halts whenever p halts.

  56. def liftSecond[A, B, C](f: (B) ⇒ Option[C])(p: Process1[A, B]): Process1[(C, A), (C, B)]

    Transform p to operate on the second element of a pair, passing through the left value with no modifications.

    Transform p to operate on the second element of a pair, passing through the left value with no modifications. Note that this halts whenever p halts.

    f

    function used to convert Bs generated during cleanup of p to pairs

  57. def liftY[I, O](p: Process1[I, O]): Wye[I, Any, O]

    Lifts Process1 to operate on Left side of wye, ignoring any right input.

    Lifts Process1 to operate on Left side of wye, ignoring any right input. Use wye.flip to convert it to right side

  58. def mapAccumulate[S, A, B](init: S)(f: (S, A) ⇒ (S, B)): Process1[A, (S, B)]

    Maps a running total according to S and the input with the function f.

    Maps a running total according to S and the input with the function f.

    Example:
    1. scala> Process("Hello", "World")
           |   .mapAccumulate(0)((l, s) => (l + s.length, s.head)).toList
      res0: List[(Int, Char)] = List((5,H), (10,W))
    See also

    zipWithScan1

  59. def maximum[A](implicit A: Order[A]): Process1[A, A]

    Emits the greatest element of the input.

  60. def maximumBy[A, B](f: (A) ⇒ B)(implicit arg0: Order[B]): Process1[A, A]

    Emits the element a of the input which yields the greatest value of f(a).

  61. def maximumOf[A, B](f: (A) ⇒ B)(implicit arg0: Order[B]): Process1[A, B]

    Emits the greatest value of f(a) for each element a of the input.

  62. def minimum[A](implicit A: Order[A]): Process1[A, A]

    Emits the smallest element of the input.

  63. def minimumBy[A, B](f: (A) ⇒ B)(implicit arg0: Order[B]): Process1[A, A]

    Emits the element a of the input which yields the smallest value of f(a).

  64. def minimumOf[A, B](f: (A) ⇒ B)(implicit arg0: Order[B]): Process1[A, B]

    Emits the smallest value of f(a) for each element a of the input.

  65. def multiplex[I, I2, O](chanL: Process1[I, O], chanR: Process1[I2, O]): Process1[\/[I, I2], O]

    Split the input and send to either chanL or chanR, halting when either branch halts.

    Split the input and send to either chanL or chanR, halting when either branch halts.

    Example:
    1. scala> import scalaz.\/._
      scala> import process1._
      scala> Process(left(1), right('a'), left(2), right('b'))
           |   .pipe(multiplex(lift(_ * -1), lift(_.toInt))).toList
      res0: List[Int] = List(-1, 97, -2, 98)
  66. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  67. final def notify(): Unit

    Definition Classes
    AnyRef
  68. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  69. def prefixSums[N](implicit N: Numeric[N]): Process1[N, N]

    Emits the sums of prefixes (running totals) of the input elements.

    Emits the sums of prefixes (running totals) of the input elements. The first value emitted will always be zero.

    Example:
    1. scala> Process(1, 2, 3).prefixSums.toList
      res0: List[Int] = List(0, 1, 3, 6)
      
      scala> Process[Int]().prefixSums.toList
      res1: List[Int] = List(0)
  70. def reduce[A](f: (A, A) ⇒ A): Process1[A, A]

    Process1 form of List.reduce.

    Process1 form of List.reduce.

    Reduces the elements of this Process using the specified associative binary operator.

    scala> Process(1, 2, 3, 4).reduce(_ + _).toList
    res0: List[Int] = List(10)
    
    scala> Process(1).reduce(_ + _).toList
    res1: List[Int] = List(1)
    
    scala> Process[Int]().reduce(_ + _).toList
    res2: List[Int] = List()

    Unlike List.reduce will not fail when Process is empty.

  71. def reduceMap[A, B](f: (A) ⇒ B)(implicit M: Semigroup[B]): Process1[A, B]

    Like reduce only uses f to map A to B and uses Semigroup M for associative operation.

  72. def reduceMonoid[A](implicit M: Monoid[A]): Process1[A, A]

    Alias for reduceSemigroup(M).

  73. def reduceSemigroup[A](implicit M: Semigroup[A]): Process1[A, A]

    Like reduce but uses Semigroup M for associative operation.

  74. def repartition[I](p: (I) ⇒ IndexedSeq[I])(implicit I: Semigroup[I]): Process1[I, I]

    Repartitions the input with the function p.

    Repartitions the input with the function p. On each step p is applied to the input and all elements but the last of the resulting sequence are emitted. The last element is then prepended to the next input using the Semigroup I. For example,

    scala> import scalaz.std.string._
    scala> Process("Hel", "l", "o Wor", "ld").repartition(_.split(" ")).toList
    res0: List[String] = List(Hello, World)
  75. def repartition2[I](p: (I) ⇒ (Option[I], Option[I]))(implicit I: Semigroup[I]): Process1[I, I]

    Repartitions the input with the function p.

    Repartitions the input with the function p. On each step p is applied to the input and the first element of the resulting tuple is emitted if it is Some(x). The second element is then prepended to the next input using the Semigroup I. In comparison to repartition this allows to emit single inputs without prepending them to the next input.

  76. def rethrow[A]: Process1[\/[Throwable, A], A]

    Throws any input exceptions and passes along successful results.

  77. def scan[A, B](z: B)(f: (B, A) ⇒ B): Process1[A, B]

    Similar to List.

    Similar to List.scan. Produces a process of B containing cumulative results of applying the operator to Process of A. It will always emit z, even when the Process of A is empty

  78. def scan1[A](f: (A, A) ⇒ A): Process1[A, A]

    Similar to scan, but unlike it it won't emit the z even when there is no input of A.

    Similar to scan, but unlike it it won't emit the z even when there is no input of A.

    scala> Process(1, 2, 3, 4).scan1(_ + _).toList
    res0: List[Int] = List(1, 3, 6, 10)
    
    scala> Process(1).scan1(_ + _).toList
    res1: List[Int] = List(1)
    
    scala> Process[Int]().scan1(_ + _).toList
    res2: List[Int] = List()
  79. def scan1Map[A, B](f: (A) ⇒ B)(implicit M: Semigroup[B]): Process1[A, B]

    Like scan1 only uses f to map A to B and uses Semigroup M for associative operation.

  80. def scan1Monoid[A](implicit M: Monoid[A]): Process1[A, A]

    Alias for scanSemigroup(M).

  81. def scanMap[A, B](f: (A) ⇒ B)(implicit M: Monoid[B]): Process1[A, B]

    Like scan only uses f to map A to B and uses Monoid M for associative operation

  82. def scanMonoid[A](implicit M: Monoid[A]): Process1[A, A]

    Like scan but uses Monoid for associative operation

  83. def scanSemigroup[A](implicit M: Semigroup[A]): Process1[A, A]

    Like scan1 but uses Semigroup M for associative operation.

  84. def shiftRight[I](head: I*): Process1[I, I]

    Emit the given values, then echo the rest of the input.

    Emit the given values, then echo the rest of the input.

    Example:
    1. scala> Process(3, 4).shiftRight(1, 2).toList
      res0: List[Int] = List(1, 2, 3, 4)
  85. def skip: Process1[Any, Nothing]

    Reads a single element of the input, emits nothing, then halts.

    Reads a single element of the input, emits nothing, then halts.

    Example:
    1. scala> import process1._
      scala> Process(1, 2, 3).pipe(skip ++ id).toList
      res0: List[Int] = List(2, 3)
  86. def sliding[I](n: Int): Process1[I, Vector[I]]

    Groups inputs in fixed size chunks by passing a "sliding window" of size n over them.

    Groups inputs in fixed size chunks by passing a "sliding window" of size n over them. If the input contains less than or equal to n elements, only one chunk of this size will be emitted.

    Example:
    1. scala> Process(1, 2, 3, 4).sliding(2).toList
      res0: List[Vector[Int]] = List(Vector(1, 2), Vector(2, 3), Vector(3, 4))
    Exceptions thrown
    IllegalArgumentException

    if n <= 0

  87. def split[I](f: (I) ⇒ Boolean): Process1[I, Vector[I]]

    Break the input into chunks where the delimiter matches the predicate.

    Break the input into chunks where the delimiter matches the predicate. The delimiter does not appear in the output. Two adjacent delimiters in the input result in an empty chunk in the output.

  88. def splitOn[I](i: I)(implicit arg0: Equal[I]): Process1[I, Vector[I]]

    Break the input into chunks where the input is equal to the given delimiter.

    Break the input into chunks where the input is equal to the given delimiter. The delimiter does not appear in the output. Two adjacent delimiters in the input result in an empty chunk in the output.

  89. def splitWith[I](f: (I) ⇒ Boolean): Process1[I, Vector[I]]

    Breaks the input into chunks that alternatively satisfy and don't satisfy the predicate f.

    Breaks the input into chunks that alternatively satisfy and don't satisfy the predicate f.

    Example:
    1. scala> Process(1, 2, -3, -4, 5, 6).splitWith(_ < 0).toList
      res0: List[Vector[Int]] = List(Vector(1, 2), Vector(-3, -4), Vector(5, 6))
  90. def stateScan[S, A, B](init: S)(f: (A) ⇒ State[S, B]): Process1[A, B]

  91. def stripNone[A]: Process1[Option[A], A]

    Remove any None inputs.

  92. def sum[N](implicit N: Numeric[N]): Process1[N, N]

    Emits the sum of all input elements or zero if the input is empty.

    Emits the sum of all input elements or zero if the input is empty.

    Example:
    1. scala> Process(1, 2, 3).sum.toList
      res0: List[Int] = List(6)
      
      scala> Process[Int]().sum.toList
      res1: List[Int] = List(0)
  93. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  94. def tail[I]: Process1[I, I]

    Emits all elements of the input except the first one.

    Emits all elements of the input except the first one.

    Example:
    1. scala> Process(1, 2, 3).tail.toList
      res0: List[Int] = List(2, 3)
      
      scala> Process[Int]().tail.toList
      res1: List[Int] = List()
  95. def take[I](n: Int): Process1[I, I]

    Passes through n elements of the input, then halts.

  96. def takeRight[I](n: Int): Process1[I, I]

    Emits the last n elements of the input.

  97. def takeThrough[I](f: (I) ⇒ Boolean): Process1[I, I]

    Like takeWhile, but emits the first value which tests false.

  98. def takeWhile[I](f: (I) ⇒ Boolean): Process1[I, I]

    Passes through elements of the input as long as the predicate is true, then halts.

  99. def terminated[A]: Process1[A, Option[A]]

    Wraps all inputs in Some, then outputs a single None before halting.

  100. def toString(): String

    Definition Classes
    AnyRef → Any
  101. def unchunk[I]: Process1[Seq[I], I]

    Ungroups chunked input.

    Ungroups chunked input.

    Example:
    1. scala> Process(Seq(1, 2), Seq(3)).pipe(process1.unchunk).toList
      res0: List[Int] = List(1, 2, 3)
  102. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  105. def zipWithIndex[A, N](implicit N: Numeric[N]): Process1[A, (A, N)]

    Zips the input with an index of type N.

  106. def zipWithIndex[A]: Process1[A, (A, Int)]

    Zips the input with an index of type Int.

  107. def zipWithNext[I]: Process1[I, (I, Option[I])]

    Zips every element with its next element wrapped into Some.

    Zips every element with its next element wrapped into Some. The last element is zipped with None.

  108. def zipWithPrevious[I]: Process1[I, (Option[I], I)]

    Zips every element with its previous element wrapped into Some.

    Zips every element with its previous element wrapped into Some. The first element is zipped with None.

  109. def zipWithPreviousAndNext[I]: Process1[I, (Option[I], I, Option[I])]

    Zips every element with its previous and next elements wrapped into Some.

    Zips every element with its previous and next elements wrapped into Some. The first element is zipped with None as the previous element, the last element is zipped with None as the next element.

  110. def zipWithScan[A, B](z: B)(f: (A, B) ⇒ B): Process1[A, (A, B)]

    Zips the input with a running total according to B, up to but not including the current element.

    Zips the input with a running total according to B, up to but not including the current element. Thus the initial z value is the first emitted to the output:

    scala> Process("uno", "dos", "tres", "cuatro").zipWithScan(0)(_.length + _).toList
    res0: List[(String,Int)] = List((uno,0), (dos,3), (tres,6), (cuatro,10))
    See also

    zipWithScan1

  111. def zipWithScan1[A, B](z: B)(f: (A, B) ⇒ B): Process1[A, (A, B)]

    Zips the input with a running total according to B, up to and including the current element.

    Zips the input with a running total according to B, up to and including the current element. Thus the initial z value is not emitted to the output:

    scala> Process("uno", "dos", "tres", "cuatro").zipWithScan1(0)(_.length + _).toList
    res0: List[(String,Int)] = List((uno,3), (dos,6), (tres,10), (cuatro,16))
    See also

    zipWithScan

  112. def zipWithState[A, B](z: B)(next: (A, B) ⇒ B): Process1[A, (A, B)]

    Zips the input with state that begins with z and is updated by next.

Inherited from AnyRef

Inherited from Any

Ungrouped