object Pull
- Source
- Pull.scala
- Alphabetic
- By Inheritance
- Pull
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
sealed abstract
class
Cancellable[+F[_], +R] extends AnyRef
Result of
acquireCancellable
. - final class PartiallyAppliedFromEither[F[_]] extends AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
acquire[F[_], R](r: F[R])(cleanup: (R) ⇒ F[Unit]): Pull[F, Nothing, R]
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 returnedPull
. The acquired resource is returned as the result value of the pull. -
def
acquireCancellable[F[_], R](r: F[R])(cleanup: (R) ⇒ F[Unit]): Pull[F, Nothing, Cancellable[F, R]]
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.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
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. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
implicit
def
covaryPure[F[_], O, R, O2 >: O, R2 >: R](p: Pull[Pure, O, R]): Pull[F, O2, R2]
Implicitly covaries a pull.
-
val
done: Pull[Nothing, Nothing, Unit]
The completed
Pull
.The completed
Pull
. Reads and outputs nothing. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eval[F[_], R](fr: F[R]): Pull[F, Nothing, R]
Evaluates the supplied effectful value and returns the result as the resource of the returned pull.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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].
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[Nothing]] = Failure(java.lang.RuntimeException)
Example: -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
loop[F[_], O, R](using: (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.
Repeatedly uses the output of the pull as input for the next step of the pull. Halts when a step terminates with
None
orPull.raiseError
. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
output[F[_], O](os: Segment[O, Unit]): Pull[F, O, Unit]
Ouptuts a segment of values.
-
def
output1[F[_], O](o: O): Pull[F, O, Unit]
Ouptuts a single value.
-
def
outputChunk[F[_], O](os: Chunk[O]): Pull[F, O, Unit]
Ouptuts a chunk of values.
-
def
pure[F[_], R](r: R): Pull[F, Nothing, R]
Pull that outputs nothing and has result of
r
. -
def
raiseError(err: Throwable): Pull[Nothing, Nothing, Nothing]
Reads and outputs nothing, and fails with the given error.
-
def
segment[F[_], O, R](s: Segment[O, R]): Pull[F, O, R]
Pull that outputs the specified segment and returns the result of the segment as the result of the pull.
Pull that outputs the specified segment and returns the result of the segment as the result of the pull. Less efficient than output.
-
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.
-
implicit
def
syncInstance[F[_], O]: Sync[[γ$6$]Pull[F, O, γ$6$]]
Sync
instance forStream
. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- object Cancellable