Result of acquireCancellable
.
Acquire a resource within a Pull
.
Acquire a resource within a Pull
. The cleanup action will be run at the end
of the .stream
scope which executes the returned Pull
. The acquired
resource is returned as the result value of the pull.
Like acquire but the result value consists of a cancellation pull and the acquired resource.
Like acquire but the result value consists of a cancellation pull and the acquired resource. Running the cancellation pull frees the resource. This allows the acquired resource to be released earlier than at the end of the containing pull scope.
Like acquireCancellable but provides an ExitCase[Throwable]
to the cleanup
action,
indicating the cause for cleanup execution.
Like eval but if the effectful value fails, the exception is returned in a Left
instead of failing the pull.
The completed Pull
.
The completed Pull
. Reads and outputs nothing.
Evaluates the supplied effectful value and returns the result as the resource of the returned pull.
Lifts an Either[Throwable, A] to an effectful Pull[F, A, Unit].
Lifts an Either[Throwable, A] to an effectful Pull[F, A, Unit].
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)
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
.
Outputs a chunk of values.
Outputs a single value.
Pull that outputs nothing and has result of r
.
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]
).
Returns a pull that evaluates the supplied by-name each time the pull is used, allowing use of a mutable value in pull computations.
Sync
instance for Pull
.