Pull

object Pull extends PullLowPriority
Companion
class
trait PullLowPriority
class Object
trait Matchable
class Any

Type members

Classlikes

final class PartiallyAppliedFromEither[F[_]]

Value members

Concrete methods

def attemptEval[F[_], R](fr: F[R]): Pull[F, INothing, Either[Throwable, R]]

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

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

def eval[F[_], R](fr: F[R]): Pull[F, INothing, R]

Evaluates the supplied effectful value and returns the result as the resource of the returned pull.

Evaluates the supplied effectful value and returns the result as the resource of the returned pull.

def extendScopeTo[F[_], O](s: Stream[F, O])(F: MonadError[F, Throwable]): Pull[F, INothing, 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.

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.

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
scala> import cats.effect.IO, scala.util.Try
scala> Pull.fromEither[IO](Right(42)).stream.compile.toList.unsafeRunSync()
res0: List[Int] = List(42)
scala> Try(Pull.fromEither[IO](Left(new RuntimeException)).stream.compile.toList.unsafeRunSync())
res1: Try[List[INothing]] = Failure(java.lang.RuntimeException)
def getScope[F[_]]: Pull[F, INothing, Scope[F]]

Gets the current scope, allowing manual leasing or interruption. This is a low-level method and generally should not be used by user code.

Gets the current scope, allowing manual leasing or interruption. This is a low-level method and generally should not be used by user code.

def loop[F[_], O, R](f: R => Pull[F, O, Option[R]]): R => Pull[F, O, Option[R]]

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.

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.

def output[F[x], O](os: Chunk[O]): Pull[F, O, Unit]

Outputs a chunk of values.

Outputs a chunk of values.

def output1[F[x], O](o: O): Pull[F, O, Unit]

Outputs a single value.

Outputs a single value.

def pure[F[x], R](r: R): Pull[F, INothing, R]

Pull that outputs nothing and has result of r.

Pull that outputs nothing and has result of r.

def raiseError[F[_]](err: Throwable)(`evidence$1`: RaiseThrowable[F]): Pull[F, INothing, INothing]

Reads and outputs nothing, and fails with the given error.

Reads and outputs nothing, and fails with the given error.

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

def suspend[F[x], 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.

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

Concrete fields

val done: Pull[Pure, INothing, Unit]

The completed Pull. Reads and outputs nothing.

The completed Pull. Reads and outputs nothing.

Implicits

Implicits

implicit def functionKInstance[F[_]]: FunctionK[F, [_] =>> Pull[F, INothing, _$17]]

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

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

Example
scala> import cats.Id
scala> Pull.functionKInstance[Id](42).flatMap(Pull.output1).stream.compile.toList
res0: cats.Id[List[Int]] = List(42)
implicit def syncInstance[F[_], O](ev: ApplicativeError[F, Throwable]): Sync[[_] =>> Pull[F, O, _$15]]

Sync instance for Pull.

Sync instance for Pull.

Inherited implicits

implicit def monadInstance[F[_], O]: Monad[[_] =>> Pull[F, O, _$20]]
Inherited from
PullLowPriority