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, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Iterant
  2. Serializable
  3. Serializable
  4. IterantInstances
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class CatsSyncInstances[F[_]] extends StackSafeMonad[[β$0$]Iterant[F, β$0$]] with MonadError[[β$1$]Iterant[F, β$1$], Throwable] with Defer[[β$2$]Iterant[F, β$2$]] with MonoidK[[β$3$]Iterant[F, β$3$]] with CoflatMap[[β$4$]Iterant[F, β$4$]]

    Permalink

    Provides the cats.effect.Sync instance for Iterant.

    Provides the cats.effect.Sync instance for Iterant.

    Definition Classes
    IterantInstances
  2. final case class Concat[F[_], A](lh: F[Iterant[F, A]], rh: F[Iterant[F, A]]) extends Iterant[F, A] with Product with Serializable

    Permalink

    The Concat state of the Iterant represents a state that specifies the concatenation of two streams.

    The Concat state of the Iterant represents a state that specifies the concatenation of two streams.

    lh

    is the left hand side of the concatenation, to be processed before the right-hand side

    rh

    is the rest of the stream, to be processed after the left-hand side is

  3. 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

  4. 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

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

    Permalink

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

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

    Note that item 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

  6. final case class NextBatch[F[_], A](batch: Batch[A], rest: F[Iterant[F, A]]) 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

  7. final case class NextCursor[F[_], A](cursor: BatchCursor[A], rest: F[Iterant[F, A]]) 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

  8. final case class Scope[F[_], A, B](acquire: F[A], use: (A) ⇒ F[Iterant[F, B]], release: (A, ExitCase[Throwable]) ⇒ F[Unit]) extends Iterant[F, B] with Product with Serializable

    Permalink

    The Scope state of the Iterant represents a stream that is able to specify the acquisition and release of a resource, to be used in generating stream events.

    The Scope state of the Iterant represents a stream that is able to specify the acquisition and release of a resource, to be used in generating stream events.

    Scope is effectively the encoding of Bracket, necessary for safe handling of resources. The use parameter is supposed to trigger a side effectful action that allocates resources, which are then used via use and released via close.

    Note that this is often used in combination with Suspend and data types like cats.effect.concurrent.Ref in order to communicate the acquired resources between open, use and close.

    acquire

    is an effect that should allocate necessary resources to be used in use and released in close

    use

    is the stream created via this scope

    release

    is an effect that should deallocate acquired resources via open and that will be executed no matter what

  9. final case class Suspend[F[_], A](rest: F[Iterant[F, A]]) 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

  10. abstract class Visitor[F[_], A, R] extends (Iterant[F, A]) ⇒ R

    Permalink

    Implements the Visitor Pattern for interpreting the Iterant data structure.

    Implements the Visitor Pattern for interpreting the Iterant data structure.

    This can be used as an alternative to pattern matching and is used in the implementation of Iterant for performance reasons.

    WARN: this being a class instead of a recursive function, it means that it often has to keep "shared state". Keeping shared state is great for performance, but breaks referential transparency, so use with care.

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[_]]: IterantBuilders[F]

    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 catsSyncInstances[F[_]](implicit F: Sync[F]): CatsSyncInstances[F]

    Permalink

    Provides the cats.effect.Sync instance for Iterant.

    Provides the cats.effect.Sync instance for Iterant.

    Definition Classes
    IterantInstances
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def concat[F[_], A](xs: Iterant[F, A]*)(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Concatenates list of Iterants into a single stream

  9. def concatS[F[_], A](lh: F[Iterant[F, A]], rh: F[Iterant[F, A]]): Iterant[F, A]

    Permalink

    Builds a stream state equivalent with Iterant.Concat.

    Builds a stream state equivalent with Iterant.Concat.

    The Concat state of the Iterant represents a state that specifies the concatenation of two streams.

    lh

    is the left hand side of the concatenation, to be processed before the right-hand side

    rh

    is the rest of the stream, to be processed after the left-hand side is

  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 delay[F[_], A](a: ⇒ A)(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Alias for eval.

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

    Permalink

    Returns an empty stream.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. 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.

  16. def finalize(): Unit

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

    Permalink

    Converts any standard Array into a stream.

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

    Permalink

    Converts a Batch into a stream.

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

    Permalink

    Converts a BatchCursor into a stream.

  20. 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).

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

    Permalink

    Converts a scala.collection.Iterable into a stream.

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

    Permalink

    Converts a scala.collection.Iterator into a stream.

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

    Permalink

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

  24. def fromReactivePublisher[F[_], A](publisher: Publisher[A], requestCount: Int = 256, eagerBuffer: Boolean = true)(implicit F: Async[F]): Iterant[F, A]

    Permalink

    Given an org.reactivestreams.Publisher, converts it into an Iterant.

    Given an org.reactivestreams.Publisher, converts it into an Iterant.

    publisher

    is the org.reactivestreams.Publisher reference to wrap into an Iterant

    requestCount

    a strictly positive number, representing the size of the buffer used and the number of elements requested on each cycle when communicating demand, compliant with the reactive streams specification. If Int.MaxValue is given, then no back-pressuring logic will be applied (e.g. an unbounded buffer is used and the source has a license to stream as many events as it wants)

    eagerBuffer

    can activate or deactivate the "eager buffer" mode in which the buffer gets pre-filled before the Iterant's consumer is ready to process it — this prevents having pauses due to back-pressuring the Subscription.request(n) calls

    See also

    Iterant.toReactivePublisher for converting an Iterant to a reactive publisher.

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

    Permalink

    Converts any scala.collection.Seq into a stream.

  26. def fromStateAction[F[_], S, A](f: (S) ⇒ (A, S))(seed: ⇒ S)(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Given an initial state and a generator function that produces the next state and the next element in the sequence, creates an Iterant that keeps generating NextBatch items produced by our generator function with default recommendedBatchSize.

    Given an initial state and a generator function that produces the next state and the next element in the sequence, creates an Iterant that keeps generating NextBatch items produced by our generator function with default recommendedBatchSize.

    Example:

    val f = (x: Int) => (x + 1, x * 2)
    val seed = 1
    val stream = Iterant.fromStateAction[Task, Int, Int](f)(seed)
    
    // Yields 2, 3, 5, 9
    stream.take(5)
    See also

    fromStateActionL for version supporting F[_] in result of generator function and seed element

  27. def fromStateActionL[F[_], S, A](f: (S) ⇒ F[(A, S)])(seed: ⇒ F[S])(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Given an initial state and a generator function that produces the next state and the next element in the sequence in F[_] context, creates an Iterant that keeps generating Next items produced by our generator function.

    Given an initial state and a generator function that produces the next state and the next element in the sequence in F[_] context, creates an Iterant that keeps generating Next items produced by our generator function.

    Example:

    val f = (x: Int) => F.pure((x + 1, x * 2))
    val seed = F.pure(1)
    val stream = Iterant.fromStateAction[Task, Int, Int](f)(seed)
    
    // Yields 2, 3, 5, 9
    stream.take(5)
    See also

    fromStateAction for version without F[_] context which generates NextBatch items

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

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

    Permalink

    Data constructor for building a Iterant.Halt value.

    Data constructor for building a Iterant.Halt value.

    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

  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. def intervalAtFixedRate[F[_]](initialDelay: FiniteDuration, period: FiniteDuration)(implicit F: Async[F], timer: Timer[F]): Iterant[F, Long]

    Permalink

    Creates an iterant that emits auto-incremented natural numbers (longs).

    Creates an iterant that emits auto-incremented natural numbers (longs). at a fixed rate, as given by the specified period. The amount of time it takes to process an incoming value gets subtracted from provided period, thus created iterant tries to emit events spaced by the given time interval, regardless of how long further processing takes

    This version of the intervalAtFixedRate allows specifying an initialDelay before first value is emitted

    initialDelay

    initial delay before emitting the first value

    period

    period between 2 successive emitted values

    timer

    is the timer implementation used to generate delays and to fetch the current time

  32. def intervalAtFixedRate[F[_]](period: FiniteDuration)(implicit F: Async[F], timer: Timer[F]): Iterant[F, Long]

    Permalink

    Creates an iterant that emits auto-incremented natural numbers (longs).

    Creates an iterant that emits auto-incremented natural numbers (longs). at a fixed rate, as given by the specified period. The amount of time it takes to process an incoming value gets subtracted from provided period, thus created iterant tries to emit events spaced by the given time interval, regardless of how long further processing takes

    period

    period between 2 successive emitted values

    timer

    is the timer implementation used to generate delays and to fetch the current time

  33. def intervalWithFixedDelay[F[_]](initialDelay: FiniteDuration, delay: FiniteDuration)(implicit F: Async[F], timer: Timer[F]): Iterant[F, Long]

    Permalink

    Creates an iterant that emits auto-incremented natural numbers (longs) spaced by a given time interval.

    Creates an iterant that emits auto-incremented natural numbers (longs) spaced by a given time interval. Starts from 0 with no delay, after which it emits incremented numbers spaced by the period of time. The given period of time acts as a fixed delay between successive events.

    initialDelay

    is the delay to wait before emitting the first event

    delay

    the time to wait between 2 successive events

    timer

    is the timer implementation used to generate delays and to fetch the current time

  34. def intervalWithFixedDelay[F[_]](delay: FiniteDuration)(implicit F: Async[F], timer: Timer[F]): Iterant[F, Long]

    Permalink

    Creates an iterant that emits auto-incremented natural numbers (longs) spaced by a given time interval.

    Creates an iterant that emits auto-incremented natural numbers (longs) spaced by a given time interval. Starts from 0 with no delay, after which it emits incremented numbers spaced by the period of time. The given period of time acts as a fixed delay between successive events.

    Without having an initial delay specified, this overload will immediately emit the first item, without any delays.

    delay

    the time to wait between 2 successive events

    timer

    is the timer implementation used to generate delays and to fetch the current time

  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. 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

  37. def liftF[F[_], A](fa: F[A])(implicit F: Functor[F]): Iterant[F, A]

    Permalink

    Lifts a value from monadic context into the stream context, returning a stream of one element

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

    Permalink
    Definition Classes
    AnyRef
  39. def never[F[_], A](implicit F: Async[F]): Iterant[F, A]

    Permalink

    Returns a stream that never emits any event and never completes.

  40. def nextBatchS[F[_], A](items: Batch[A], rest: F[Iterant[F, A]]): Iterant[F, A]

    Permalink

    Data constructor for building a Iterant.NextBatch value.

    Data constructor for building a Iterant.NextBatch value.

    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

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

    Permalink

    Data constructor for building a Iterant.NextCursor value.

    Data constructor for building a Iterant.NextCursor value.

    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

  42. def nextS[F[_], A](item: A, rest: F[Iterant[F, A]]): Iterant[F, A]

    Permalink

    Data constructor for building a Iterant.Next value.

    Data constructor for building a Iterant.Next value.

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

    Note that item 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

  43. final def notify(): Unit

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

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

    Permalink

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

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

    Permalink

    Alias for now.

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

    Permalink

    Returns an empty stream that ends with an error.

  48. 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

  49. def repeat[F[_], A](elems: A*)(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Builds a stream that repeats the items provided in argument.

    Builds a stream that repeats the items provided in argument.

    It terminates either on error or if the source is empty.

  50. def repeatEval[F[_], A](thunk: ⇒ A)(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Builds a stream that suspends provided thunk and evaluates it indefinitely on-demand.

    Builds a stream that suspends provided thunk and evaluates it indefinitely on-demand.

    The stream will only terminate if evaluation throws an exception

    Referentially transparent alternative to Iterator.continually

    Example: infinite sequence of random numbers

    import scala.util.Random
    
    val randomInts = Iterant[Coeval].repeatEval(Random.nextInt())
  51. def repeatEvalF[F[_], A](fa: F[A])(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Builds a stream that evaluates provided effectful values indefinitely.

    Builds a stream that evaluates provided effectful values indefinitely.

    The stream will only terminate if an error is raised in F context

  52. def resource[F[_], A](acquire: F[A])(release: (A) ⇒ F[Unit])(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Creates a stream that depends on resource allocated by a monadic value, ensuring the resource is released.

    Creates a stream that depends on resource allocated by a monadic value, ensuring the resource is released.

    Typical use-cases are working with files or network sockets

    Example:

    val printer =
      Iterant.resource {
        IO(new PrintWriter("./lines.txt"))
      } { writer =>
        IO(writer.close())
      }
    
    // Safely use the resource, because the release is
    // scheduled to happen afterwards
    val writeLines = printer.flatMap { writer =>
      Iterant[IO]
        .fromIterator(Iterator.from(1))
        .mapEval(i => IO { writer.println(s"Line #$i") })
    }
    
    // Write 100 numbered lines to the file
    // closing the writer when finished
    writeLines.take(100).completeL.unsafeRunSync()
    acquire

    resource to acquire at the start of the stream

    release

    function that releases the acquired resource

  53. def resourceCase[F[_], A](acquire: F[A])(release: (A, ExitCase[Throwable]) ⇒ F[Unit])(implicit F: Sync[F]): Iterant[F, A]

    Permalink

    Creates a stream that depends on resource allocated by a monadic value, ensuring the resource is released.

    Creates a stream that depends on resource allocated by a monadic value, ensuring the resource is released.

    Typical use-cases are working with files or network sockets

    Example:

    val printer =
      Iterant.resource {
        IO(new PrintWriter("./lines.txt"))
      } { writer =>
        IO(writer.close())
      }
    
    // Safely use the resource, because the release is
    // scheduled to happen afterwards
    val writeLines = printer.flatMap { writer =>
      Iterant[IO]
        .fromIterator(Iterator.from(1))
        .mapEval(i => IO { writer.println(s"Line #$i") })
    }
    
    // Write 100 numbered lines to the file
    // closing the writer when finished
    writeLines.take(100).completeL.unsafeRunSync()
    acquire

    an effect that acquires an expensive resource

    release

    function that releases the acquired resource

  54. def scopeS[F[_], A, B](acquire: F[A], use: (A) ⇒ F[Iterant[F, B]], release: (A, ExitCase[Throwable]) ⇒ F[Unit]): Iterant[F, B]

    Permalink

    Builds a stream state equivalent with Iterant.Scope.

    Builds a stream state equivalent with Iterant.Scope.

    The Scope state of the Iterant represents a stream that is able to specify the acquisition and release of a resource, to be used in generating stream events.

    Scope is effectively the encoding of Bracket, necessary for safe handling of resources. The use parameter is supposed to trigger a side effectful action that allocates resources, which are then used via use and released via close.

    Note that this is often used in combination with Suspend and data types like cats.effect.concurrent.Ref in order to communicate the acquired resources between open, use and close.

    acquire

    is an effect that should allocate necessary resources to be used in use and released in close

    use

    is the stream created via this scope

    release

    is an effect that should deallocate acquired resources via open and that will be executed no matter what

  55. def suspend[F[_], A](rest: F[Iterant[F, A]]): 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

  56. 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

  57. def suspendS[F[_], A](rest: F[Iterant[F, A]]): 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

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

    Permalink
    Definition Classes
    AnyRef
  59. 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.

  60. def toString(): String

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

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from IterantInstances

Inherited from AnyRef

Inherited from Any

Ungrouped