Class/Object

cats.data

StreamingT

Related Docs: object StreamingT | package data

Permalink

sealed abstract class StreamingT[F[_], A] extends AnyRef

StreamingT[F, A] is a monad transformer which parallels Streaming[A].

However, there are a few key differences. StreamingT[F, A] only supports lazy evaluation if F does, and if the F[_] values are constructed lazily. Also, monadic recursion on StreamingT[F, A] is stack-safe only if monadic recursion on F is stack-safe. Finally, since F is not guaranteed to have a Comonad, it does not support many methods on Streaming[A] which return immediate values.

Self Type
StreamingT[F, A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StreamingT
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def %::(a: A)(implicit ev: Applicative[F]): StreamingT[F, A]

    Permalink

    Prepend an A value to the current stream.

  4. def %:::(lhs: StreamingT[F, A])(implicit ev: Functor[F]): StreamingT[F, A]

    Permalink

    Prepend a StreamingT[F, A] value to the current stream.

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def coflatMap[B](f: (StreamingT[F, A]) ⇒ B)(implicit ev: Functor[F]): StreamingT[F, B]

    Permalink

    xyz

  9. def concat(rhs: F[StreamingT[F, A]])(implicit ev: Monad[F]): StreamingT[F, A]

    Permalink

    Concatenate streaming values within F[_].

    Concatenate streaming values within F[_].

    This method is useful when calling .flatMap over a F[StreamingT[F, A]] value.

  10. def drop(n: Int)(implicit ev: Functor[F]): StreamingT[F, A]

    Permalink

    Return a stream consisting of all but the first n elements of this stream.

    Return a stream consisting of all but the first n elements of this stream.

    If the current stream has n or fewer elements, an empty stream will be returned.

  11. def dropWhile(f: (A) ⇒ Boolean)(implicit ev: Functor[F]): StreamingT[F, A]

    Permalink

    From the beginning of this stream, create a new stream which removes all elements that fulfill the predicate f.

    From the beginning of this stream, create a new stream which removes all elements that fulfill the predicate f. Once an element is found which does not fulfill the predicate, that element and all subsequent elements will be returned.

    If all elements satisfy f, an empty stream will be returned. If no elements satisfy f, the current stream will be returned.

    For example:

    StreamingT[List, Int](1, 2, 3, 4, 5, 6, 7).dropWhile(n => n != 4)

    Will result in: StreamingT[List, Int](4, 5, 6, 7)

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def exists(f: (A) ⇒ Boolean)(implicit ev: Monad[F]): F[Boolean]

    Permalink

    Return true if some element of the stream satisfies the predicate, false otherwise.

  15. def fconcat(rhs: F[StreamingT[F, A]])(implicit ev: Monad[F]): F[StreamingT[F, A]]

    Permalink

    Concatenate streaming values within F[_].

    Concatenate streaming values within F[_].

    This method is useful when calling .flatMap over a F[StreamingT[F, A]] value.

  16. def filter(f: (A) ⇒ Boolean)(implicit ev: Functor[F]): StreamingT[F, A]

    Permalink

    Lazily filter the stream given the predicate f.

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def find(f: (A) ⇒ Boolean)(implicit ev: Monad[F]): F[Option[A]]

    Permalink

    Eagerly search the stream from the left.

    Eagerly search the stream from the left. The search ends when f returns true for some a, or the stream is exhausted. Some(a) signals a match, None means no matching items were found.

  19. def flatMap[B](f: (A) ⇒ StreamingT[F, B])(implicit ev: Monad[F]): StreamingT[F, B]

    Permalink

    Lazily transform the stream given a function f.

  20. def foldLeft[B](b: B)(f: (B, A) ⇒ B)(implicit ev: Monad[F]): F[B]

    Permalink

    Eagerly fold the stream to a single value from the left.

  21. def forall(f: (A) ⇒ Boolean)(implicit ev: Monad[F]): F[Boolean]

    Permalink

    Return true if every element of the stream satisfies the predicate, false otherwise.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  24. def isEmpty(implicit ev: Monad[F]): F[Boolean]

    Permalink

    Return true if the stream is empty, false otherwise.

    Return true if the stream is empty, false otherwise.

    In this case of deferred streams this will force the first element to be calculated.

  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. def map[B](f: (A) ⇒ B)(implicit ev: Functor[F]): StreamingT[F, B]

    Permalink

    Lazily transform the stream given a function f.

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

    Permalink
    Definition Classes
    AnyRef
  28. def nonEmpty(implicit ev: Monad[F]): F[Boolean]

    Permalink

    Return true if the stream is non-empty, false otherwise.

    Return true if the stream is non-empty, false otherwise.

    In this case of deferred streams this will force the first element to be calculated.

  29. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def take(n: Int)(implicit ev: Functor[F]): StreamingT[F, A]

    Permalink

    Return a stream consisting only of the first n elements of this stream.

    Return a stream consisting only of the first n elements of this stream.

    If the current stream has n or fewer elements, the entire stream will be returned.

  33. def takeWhile(f: (A) ⇒ Boolean)(implicit ev: Functor[F]): StreamingT[F, A]

    Permalink

    From the beginning of this stream, create a new stream which takes only those elements that fulfill the predicate f.

    From the beginning of this stream, create a new stream which takes only those elements that fulfill the predicate f. Once an element is found which does not fulfill the predicate, no further elements will be returned.

    If all elements satisfy f, the current stream will be returned. If no elements satisfy f, an empty stream will be returned.

    For example:

    StreamingT[List, Int](1, 2, 3, 4, 5, 6, 7).takeWhile(n => n != 4)

    Will result in: StreamingT[List, Int](1, 2, 3)

  34. def toList(implicit ev: Monad[F]): F[List[A]]

    Permalink

    Provide a list of elements in the stream.

    Provide a list of elements in the stream.

    This will evaluate the stream immediately, and will hang in the case of infinite streams.

  35. def toString(): String

    Permalink

    Basic string representation of a stream.

    Basic string representation of a stream.

    This method will not force evaluation of any lazy part of a stream. As a result, you will see at most one element (the first one).

    Use .toString(n) to see the first n elements of the stream.

    Definition Classes
    StreamingT → AnyRef → Any
  36. def uncons(implicit ev: Monad[F]): F[Option[(A, F[StreamingT[F, A]])]]

    Permalink

    Deconstruct a stream into a head and tail (if available).

    Deconstruct a stream into a head and tail (if available).

    This method will evaluate the stream until it finds a head and tail, or until the stream is exhausted.

  37. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped