Object/Class

monix.tail

Iterant

Related Docs: class Iterant | package tail

Permalink

object Iterant extends IterantInstances with Serializable

Defines the standard Iterant builders.

Linear Supertypes
Serializable, Serializable, IterantInstances, IterantInstances1, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Iterant
  2. Serializable
  3. Serializable
  4. IterantInstances
  5. IterantInstances1
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class CatsInstances[F[_]] extends MonadError[[α]Iterant[F, α], Throwable] with MonoidK[[α]Iterant[F, α]] with CoflatMap[[α]Iterant[F, α]]

    Permalink

    Provides a cats.effect.Sync instance for Iterant.

    Provides a cats.effect.Sync instance for Iterant.

    Definition Classes
    IterantInstances1
  2. final case class Halt[F[_], A](e: Option[Throwable]) extends Iterant[F, A] with Product with Serializable

    Permalink

    The Halt state of the Iterant represents the completion state of a stream, with an optional exception if an error happened.

    The Halt state of the Iterant represents the completion state of a stream, with an optional exception if an error happened.

    Halt is received as a final state in the iteration process. This state cannot be followed by any other element and represents the end of the stream.

    e

    is an error to signal at the end of the stream, or None in case the stream has completed normally

  3. final case class Last[F[_], A](item: A) extends Iterant[F, A] with Product with Serializable

    Permalink

    The Last state of the Iterant represents a completion state as an alternative to Halt(None), describing one last element.

    The Last state of the Iterant represents a completion state as an alternative to Halt(None), describing one last element.

    It is introduced as an optimization, being equivalent to Next(item, F.pure(Halt(None)), F.unit), to avoid extra processing in the monadic F[_] and to short-circuit operations such as concatenation and flatMap.

    item

    is the last element being signaled, after which the consumer can stop the iteration

  4. final case class Next[F[_], A](item: A, rest: F[Iterant[F, A]], stop: F[Unit]) extends Iterant[F, A] with Product with Serializable

    Permalink

    The Next state of the Iterant represents a head / rest cons pair, where the head is a strict value.

    The Next state of the Iterant represents a head / rest cons pair, where the head is a strict value.

    Note the head being a strict value means that it is already known, whereas the rest is meant to be lazy and can have asynchronous behavior as well, depending on the F type used.

    See NextCursor for a state where the head is a strict immutable list.

    item

    is the current element to be signaled

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  5. final case class NextBatch[F[_], A](batch: Batch[A], rest: F[Iterant[F, A]], stop: F[Unit]) extends Iterant[F, A] with Product with Serializable

    Permalink

    The NextBatch state of the Iterant represents an batch / rest cons pair, where batch is an Iterable type that can generate a whole batch of elements.

    The NextBatch state of the Iterant represents an batch / rest cons pair, where batch is an Iterable type that can generate a whole batch of elements.

    batch

    is a Iterable type that can generate elements by traversing a collection, a standard array or any Iterable

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  6. final case class NextCursor[F[_], A](cursor: BatchCursor[A], rest: F[Iterant[F, A]], stop: F[Unit]) extends Iterant[F, A] with Product with Serializable

    Permalink

    The NextCursor state of the Iterant represents an batch / rest cons pair, where batch is an Iterator type that can generate a whole batch of elements.

    The NextCursor state of the Iterant represents an batch / rest cons pair, where batch is an Iterator type that can generate a whole batch of elements.

    Useful for doing buffering, or by giving it an empty iterator, useful to postpone the evaluation of the next element.

    cursor

    is an Iterator type that can generate elements by traversing a collection, a standard array or any Iterator

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  7. final case class Suspend[F[_], A](rest: F[Iterant[F, A]], stop: F[Unit]) extends Iterant[F, A] with Product with Serializable

    Permalink

    Builds a stream state equivalent with Iterant.NextCursor.

    Builds a stream state equivalent with Iterant.NextCursor.

    The Suspend state of the Iterant represents a suspended stream to be evaluated in the F context. It is useful to delay the evaluation of a stream by deferring to F.

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

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 apply[F[_]](implicit F: From[F]): Builders

    Permalink

    Returns an IterantBuilders instance for the specified F monadic type that can be used to build Iterant instances.

    Returns an IterantBuilders instance for the specified F monadic type that can be used to build Iterant instances.

    Example:

    Iterant[Task].range(0, 10)
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. implicit def catsInstances[F[_]](implicit F: Sync[F]): CatsInstances[F]

    Permalink

    Provides a Cats type class instances for Iterant.

    Provides a Cats type class instances for Iterant.

    Definition Classes
    IterantInstances1
  7. implicit def catsInstancesForCoeval(implicit F: Sync[Coeval]): CatsInstances[Coeval]

    Permalink

    Provides type class instances for Iterant[Coeval, A], based on the default instances provided by Coeval.catsSync.

    Provides type class instances for Iterant[Coeval, A], based on the default instances provided by Coeval.catsSync.

    Definition Classes
    IterantInstances
  8. implicit def catsInstancesForTask(implicit F: Async[Task]): CatsInstances[Task]

    Permalink

    Provides type class instances for Iterant[Task, A], based on the default instances provided by Task.catsAsync.

    Provides type class instances for Iterant[Task, A], based on the default instances provided by Task.catsAsync.

    Definition Classes
    IterantInstances
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def defer[F[_], A](fa: ⇒ Iterant[F, A])(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Alias for suspend.

    Alias for suspend.

    Promote a non-strict value representing a stream to a stream of the same type, effectively delaying its initialisation.

    fa

    is the by-name parameter that will generate the stream when evaluated

  11. def empty[F[_], A]: Iterant[F, A]

    Permalink

    Returns an empty stream.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def eval[F[_], A](a: ⇒ A)(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Lifts a non-strict value into the stream context, returning a stream of one element that is lazily evaluated.

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def fromArray[F[_], A](xs: Array[A])(implicit arg0: ClassTag[A], F: Applicative[F]): Iterant[F, A]

    Permalink

    Converts any standard Array into a stream.

  17. def fromIndexedSeq[F[_], A](xs: IndexedSeq[A])(implicit F: Applicative[F]): Iterant[F, A]

    Permalink

    Converts any Scala collection.IndexedSeq into a stream (e.g.

    Converts any Scala collection.IndexedSeq into a stream (e.g. Vector).

  18. def fromIterable[F[_], A](xs: Iterable[A])(implicit F: Applicative[F]): Iterant[F, A]

    Permalink

    Converts a scala.collection.Iterable into a stream.

  19. def fromIterator[F[_], A](xs: Iterator[A])(implicit F: Applicative[F]): Iterant[F, A]

    Permalink

    Converts a scala.collection.Iterator into a stream.

  20. def fromList[F[_], A](xs: LinearSeq[A])(implicit F: Applicative[F]): Iterant[F, A]

    Permalink

    Converts any Scala collection.immutable.LinearSeq into a stream.

  21. def fromSeq[F[_], A](xs: Seq[A])(implicit F: Applicative[F]): Iterant[F, A]

    Permalink

    Converts any scala.collection.Seq into a stream.

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. def haltS[F[_], A](e: Option[Throwable]): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.Halt.

    Builds a stream state equivalent with Iterant.Halt.

    The Halt state of the Iterant represents the completion state of a stream, with an optional exception if an error happened.

    Halt is received as a final state in the iteration process. This state cannot be followed by any other element and represents the end of the stream.

    e

    is an error to signal at the end of the stream, or None in case the stream has completed normally

  24. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  26. def lastS[F[_], A](item: A): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.Last.

    Builds a stream state equivalent with Iterant.Last.

    The Last state of the Iterant represents a completion state as an alternative to Halt(None), describing one last element.

    It is introduced as an optimization, being equivalent to Next(item, F.pure(Halt(None)), F.unit), to avoid extra processing in the monadic F[_] and to short-circuit operations such as concatenation and flatMap.

    item

    is the last element being signaled, after which the consumer can stop the iteration

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

    Permalink
    Definition Classes
    AnyRef
  28. def nextBatchS[F[_], A](items: Batch[A], rest: F[Iterant[F, A]], stop: F[Unit]): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.NextBatch.

    Builds a stream state equivalent with Iterant.NextBatch.

    The NextBatch state of the Iterant represents an batch / rest cons pair, where batch is an Iterable type that can generate a whole batch of elements.

    items

    is a Iterable type that can generate elements by traversing a collection, a standard array or any Iterable

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  29. def nextCursorS[F[_], A](items: BatchCursor[A], rest: F[Iterant[F, A]], stop: F[Unit]): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.NextCursor.

    Builds a stream state equivalent with Iterant.NextCursor.

    The NextCursor state of the Iterant represents an batch / rest cons pair, where batch is an Iterator type that can generate a whole batch of elements.

    Useful for doing buffering, or by giving it an empty iterator, useful to postpone the evaluation of the next element.

    items

    is an Iterator type that can generate elements by traversing a collection, a standard array or any Iterator

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  30. def nextS[F[_], A](item: A, rest: F[Iterant[F, A]], stop: F[Unit]): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.Next.

    Builds a stream state equivalent with Iterant.Next.

    The Next state of the Iterant represents a head / rest cons pair, where the head is a strict value.

    Note the head being a strict value means that it is already known, whereas the rest is meant to be lazy and can have asynchronous behavior as well, depending on the F type used.

    See NextCursor for a state where the head is a strict immutable list.

    item

    is the current element to be signaled

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  31. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  33. def now[F[_], A](a: A): Iterant[F, A]

    Permalink

    Lifts a strict value into the stream context, returning a stream of one element.

  34. def pure[F[_], A](a: A): Iterant[F, A]

    Permalink

    Alias for now.

  35. def raiseError[F[_], A](ex: Throwable): Iterant[F, A]

    Permalink

    Returns an empty stream that ends with an error.

  36. def range[F[_]](from: Int, until: Int, step: Int = 1)(implicit F: Applicative[F]): Iterant[F, Int]

    Permalink

    Builds a stream that on evaluation will produce equally spaced values in some integer interval.

    Builds a stream that on evaluation will produce equally spaced values in some integer interval.

    from

    the start value of the stream

    until

    the end value of the stream (exclusive from the stream)

    step

    the increment value of the tail (must be positive or negative)

    returns

    the tail producing values from, from + step, ... up to, but excluding until

  37. def suspend[F[_], A](rest: F[Iterant[F, A]])(implicit F: Applicative[F]): Iterant[F, A]

    Permalink

    Defers the stream generation to the underlying evaluation context (e.g.

    Defers the stream generation to the underlying evaluation context (e.g. Task, Coeval, IO, etc), building a reference equivalent with Iterant.Suspend.

    The Suspend state of the Iterant represents a suspended stream to be evaluated in the F context. It is useful to delay the evaluation of a stream by deferring to F.

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

  38. def suspend[F[_], A](fa: ⇒ Iterant[F, A])(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Promote a non-strict value representing a stream to a stream of the same type, effectively delaying its initialisation.

    Promote a non-strict value representing a stream to a stream of the same type, effectively delaying its initialisation.

    fa

    is the by-name parameter that will generate the stream when evaluated

  39. def suspendS[F[_], A](rest: F[Iterant[F, A]], stop: F[Unit]): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.NextCursor.

    Builds a stream state equivalent with Iterant.NextCursor.

    The Suspend state of the Iterant represents a suspended stream to be evaluated in the F context. It is useful to delay the evaluation of a stream by deferring to F.

    rest

    is the next state in the sequence that will produce the rest of the stream when evaluated

    stop

    is a computation to be executed in case streaming is stopped prematurely, giving it a chance to do resource cleanup (e.g. close file handles)

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def tailRecM[F[_], A, B](a: A)(f: (A) ⇒ Iterant[F, Either[A, B]])(implicit F: Sync[F]): Iterant[F, B]

    Permalink

    Keeps calling f and concatenating the resulting iterants for each scala.util.Left event emitted by the source, concatenating the resulting iterants and generating events out of scala.util.Right[B] values.

    Keeps calling f and concatenating the resulting iterants for each scala.util.Left event emitted by the source, concatenating the resulting iterants and generating events out of scala.util.Right[B] values.

    Based on Phil Freeman's Stack Safety for Free.

  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from IterantInstances

Inherited from IterantInstances1

Inherited from AnyRef

Inherited from Any

Ungrouped