Packages

object Pull extends PullLowPriority

Source
Pull.scala
Linear Supertypes
PullLowPriority, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Pull
  2. PullLowPriority
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. implicit final class IdOps[O] extends AnyVal

    Provides syntax for pure pulls based on cats.Id.

  2. final class PartiallyAppliedFromEither[F[_]] extends AnyRef
  3. implicit final class StreamPullOps[F[_], O] extends AnyVal
  4. trait Timed[F[_], O] extends AnyRef

    An abstraction for writing Pull computations that can timeout while reading from a Stream.

    An abstraction for writing Pull computations that can timeout while reading from a Stream.

    A Pull.Timed is not created or intepreted directly, but by calling Stream.ToPull.timed.

    yourStream.pull.timed(tp => ...).stream

    The argument to timed is a Pull.Timed[F, O] => Pull[F, O2, R] function, which describes the pulling logic and is often recursive, with shape:

    def go(timedPull: Pull.Timed[F, A]): Pull[F, B, Unit] =
      timedPull.uncons.flatMap {
        case Some((Right(chunk), next)) => doSomething >> go(next)
        case Some((Left(_), next)) => doSomethingElse >> go(next)
        case None => Pull.done
      }

    Where doSomething and doSomethingElse are Pull computations such as Pull.output, in addition to Pull.Timed.timeout.

    See below for detailed descriptions of timeout and uncons, and look at the Stream.ToPull.timed scaladoc for an example of usage.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def attemptEval[F[_], R](fr: F[R]): Pull[F, Nothing, Either[Throwable, R]]

    Like eval but if the effectful value fails, the exception is returned in a Left instead of failing the pull.

  6. def bracketCase[F[_], O, A, B](acquire: Pull[F, O, A], use: (A) => Pull[F, O, B], release: (A, ExitCase) => Pull[F, O, Unit]): Pull[F, O, B]
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. val done: Pull[Nothing, Nothing, Unit]

    A pull that performs no effects, emits no outputs, and always terminates successfully with a unit result.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def eval[F[_], R](fr: F[R]): Pull[F, Nothing, R]

    Creates a pull that evaluates the supplied effect fr, emits no outputs, and terminates with the result of the effect.

    Creates a pull that evaluates the supplied effect fr, emits no outputs, and terminates with the result of the effect. If the fr effect fails with an error, the new pull fails with that error.

  12. def extendScopeTo[F[_], O](s: Stream[F, O])(implicit F: MonadError[F, Throwable]): Pull[F, Nothing, Stream[F, O]]

    Extends the scope of the currently open resources to the specified stream, preventing them from being finalized until after s completes execution, even if the returned pull is converted to a stream, compiled, and evaluated before s is compiled and evaluated.

  13. def fromEither[F[x]]: PartiallyAppliedFromEither[F]

    Lifts an Either[Throwable, A] to an effectful Pull[F, A, Unit].

    Lifts an Either[Throwable, A] to an effectful Pull[F, A, Unit].

    Example:
    1. scala> import cats.effect.SyncIO, scala.util.Try
      scala> Pull.fromEither[SyncIO](Right(42)).stream.compile.toList.unsafeRunSync()
      res0: List[Int] = List(42)
      scala> Try(Pull.fromEither[SyncIO](Left(new RuntimeException)).stream.compile.toList.unsafeRunSync())
      res1: Try[List[Nothing]] = Failure(java.lang.RuntimeException)
  14. implicit def functionKInstance[F[_]]: ~>[F, [γ$1$]Pull[F, Nothing, γ$1$]]

    FunctionK instance for F ~> Pull[F, Nothing, *]

    FunctionK instance for F ~> Pull[F, Nothing, *]

    Example:
    1. scala> import cats.Id
      scala> Pull.functionKInstance[Id](42).flatMap(Pull.output1).stream.compile.toList
      res0: cats.Id[List[Int]] = List(42)
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def loop[F[_], O, R](f: (R) => Pull[F, O, Option[R]]): (R) => Pull[F, O, Unit]

    Repeatedly uses the output of the pull as input for the next step of the pull.

    Repeatedly uses the output of the pull as input for the next step of the pull. Halts when a step terminates with None or Pull.raiseError.

  19. def loopEither[F[_], O, S, R](f: (S) => Pull[F, O, Either[S, R]]): (S) => Pull[F, O, R]

    Intantiates with a state.

    Intantiates with a state. Repeatedly uses the left value of the result of the pull as input for the next step. The Pull terminates when a step terminates with Right or Pull.raiseError.

  20. implicit def monadErrorInstance[F[_], O]: MonadError[[γ$3$]Pull[F, O, γ$3$], Throwable]
    Definition Classes
    PullLowPriority
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  24. def output[F[_], O](os: Chunk[O]): Pull[F, O, Unit]

    Creates a pull that emits the elements of the given chunk.

    Creates a pull that emits the elements of the given chunk. The new pull performs no effects and terminates successfully with a unit result.

  25. def output1[F[_], O](o: O): Pull[F, O, Unit]

    Lifts the given output value O into a pull that performs no effects, emits that single output in a singleton chunk, and always terminates successfully with a unit result.

    Lifts the given output value O into a pull that performs no effects, emits that single output in a singleton chunk, and always terminates successfully with a unit result.

    _Note_: using singleton chunks is not efficient. If possible, use the chunk-based output method instead.

  26. def outputOption1[F[_], O](opt: Option[O]): Pull[F, O, Unit]

    Lifts the given optional value O into a pull that performs no effects, emits the content of that option, and always terminates successfully with a unit result.

  27. def pure[F[_], R](r: R): Pull[F, Nothing, R]

    Creates an pull that performs no effects, emits no outputs, and terminates successfully with the supplied value as its result.

  28. def raiseError[F[_]](err: Throwable)(implicit arg0: RaiseThrowable[F]): Pull[F, Nothing, Nothing]

    Lifts a throwable error into an atomic pull that emits no outputs and fails with the given error, without any result.

    Lifts a throwable error into an atomic pull that emits no outputs and fails with the given error, without any result.

    The F type must be explicitly provided (e.g., via raiseError[IO] or raiseError[Fallible]).

    Annotations
    @nowarn()
  29. def sleep[F[_]](d: FiniteDuration)(implicit t: Temporal[F]): Pull[F, Nothing, Unit]

    Creates a pull that waits for the duration d

  30. def suspend[F[_], O, R](p: => Pull[F, O, R]): Pull[F, O, R]

    Returns a pull that evaluates the supplied by-name each time the pull is used, allowing use of a mutable value in pull computations.

  31. implicit def syncInstance[F[_], O](implicit arg0: Sync[F]): Sync[[γ$0$]Pull[F, O, γ$0$]]

    Sync instance for Pull.

  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from PullLowPriority

Inherited from AnyRef

Inherited from Any

Ungrouped