final class Pull[+F[_], +O, +R] extends AnyRef
Allows acquiring elements from a stream in a resource safe way,
emitting elements of type O
, working with a resource of type R
,
and evaluating effects of type F
.
Laws:
or
forms a monoid in conjunction with done
:
or(done, p) == p
andor(p, done) == p
.or(or(p1,p2), p3) == or(p1, or(p2,p3))
fail
is caught by onError
:
onError(fail(e))(f) == f(e)
Pull
forms a monad with pure
and flatMap
:
pure >=> f == f
f >=> pure == f
(f >=> g) >=> h == f >=> (g >=> h)
wheref >=> g
is defined asa => a flatMap f flatMap g
- Source
- Pull.scala
- Alphabetic
- By Inheritance
- Pull
- AnyRef
- Any
- by covaryPure
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Pull[F, O, R], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
>>[F2[x] >: F[x], O2 >: O, R2](p2: ⇒ Pull[F2, O2, R2])(implicit S: RealSupertype[O, O2]): Pull[F2, O2, R2]
Defined as
p >> p2 == p flatMap { _ => p2 }
. -
def
as[R2](r: R2): Pull[F, O, R2]
Definition:
p as r == p map (_ => r)
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close: Stream[F, O]
Interpret this
Pull
to produce aStream
.Interpret this
Pull
to produce aStream
. The result typeR
is discarded. -
implicit
def
covary[F2[_]](implicit S: Sub1[F, F2]): Pull[F2, O, R]
Converts this pull to a pull of the specified subtype.
- def ensuring(cond: (Pull[F, O, R]) ⇒ Boolean, msg: ⇒ Any): Pull[F, O, R]
- def ensuring(cond: (Pull[F, O, R]) ⇒ Boolean): Pull[F, O, R]
- def ensuring(cond: Boolean, msg: ⇒ Any): Pull[F, O, R]
- def ensuring(cond: Boolean): Pull[F, O, R]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filter(f: (R) ⇒ Boolean): Pull[F, O, R]
If
f
returns true when passed the resource of this pull, this pull is returned.If
f
returns true when passed the resource of this pull, this pull is returned. Otherwise,Pull.done
is returned. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[F2[x] >: F[x], O2 >: O, R2](f: (R) ⇒ Pull[F2, O2, R2]): Pull[F2, O2, R2]
Applies the resource of this pull to
f
and returns the result. - def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
map[R2](f: (R) ⇒ R2): Pull[F, O, R2]
Applies the resource of this pull to
f
and returns the result in a newPull
. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
optional: Pull[F, O, Option[R]]
Returns this pull's resource wrapped in
Some
or returnsNone
if this pull fails due to an exhaustedHandle
. -
def
or[F2[x] >: F[x], O2 >: O, R2 >: R](p2: ⇒ Pull[F2, O2, R2])(implicit S1: RealSupertype[O, O2], R2: RealSupertype[R, R2]): Pull[F2, O2, R2]
Consult
p2
if this pull fails due to anawait
on an exhaustedHandle
.Consult
p2
if this pull fails due to anawait
on an exhaustedHandle
. If this pull fails due to an error,p2
is not consulted. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Pull → 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
- @throws( ... )
-
def
withFilter(f: (R) ⇒ Boolean): Pull[F, O, R]
If
f
returns true when passed the resource of this pull, this pull is returned.If
f
returns true when passed the resource of this pull, this pull is returned. Otherwise,Pull.done
is returned. - def →[B](y: B): (Pull[F, O, R], B)
Shadowed Implicit Value Members
-
def
>>[F2[x] >: F[x], O2 >: O, R2](p2: ⇒ Pull[F2, O2, R2])(implicit S: RealSupertype[O, O2]): Pull[F2, O2, R2]
Defined as
p >> p2 == p flatMap { _ => p2 }
.Defined as
p >> p2 == p flatMap { _ => p2 }
.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).>>(p2)(S)
-
def
as[R2](r: R2): Pull[Nothing, O, R2]
Definition:
p as r == p map (_ => r)
.Definition:
p as r == p map (_ => r)
.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).as(r)
-
def
close: Stream[Nothing, O]
Interpret this
Pull
to produce aStream
.Interpret this
Pull
to produce aStream
. The result typeR
is discarded.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).close
-
implicit
def
covary[F2[_]](implicit S: Sub1[Nothing, F2]): Pull[F2, O, R]
Converts this pull to a pull of the specified subtype.
Converts this pull to a pull of the specified subtype.
- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).covary(S)
-
def
filter(f: (R) ⇒ Boolean): Pull[Nothing, O, R]
If
f
returns true when passed the resource of this pull, this pull is returned.If
f
returns true when passed the resource of this pull, this pull is returned. Otherwise,Pull.done
is returned.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).filter(f)
-
def
flatMap[F2[x] >: F[x], O2 >: O, R2](f: (R) ⇒ Pull[F2, O2, R2]): Pull[F2, O2, R2]
Applies the resource of this pull to
f
and returns the result.Applies the resource of this pull to
f
and returns the result.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).flatMap(f)
-
def
map[R2](f: (R) ⇒ R2): Pull[Nothing, O, R2]
Applies the resource of this pull to
f
and returns the result in a newPull
.Applies the resource of this pull to
f
and returns the result in a newPull
.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).map(f)
-
def
optional: Pull[Nothing, O, Option[R]]
Returns this pull's resource wrapped in
Some
or returnsNone
if this pull fails due to an exhaustedHandle
.Returns this pull's resource wrapped in
Some
or returnsNone
if this pull fails due to an exhaustedHandle
.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).optional
-
def
or[F2[x] >: F[x], O2 >: O, R2 >: R](p2: ⇒ Pull[F2, O2, R2])(implicit S1: RealSupertype[O, O2], R2: RealSupertype[R, R2]): Pull[F2, O2, R2]
Consult
p2
if this pull fails due to anawait
on an exhaustedHandle
.Consult
p2
if this pull fails due to anawait
on an exhaustedHandle
. If this pull fails due to an error,p2
is not consulted.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).or(p2)(S1, R2)
-
def
toString(): String
- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).toString()
- Definition Classes
- Pull → AnyRef → Any
-
def
withFilter(f: (R) ⇒ Boolean): Pull[Nothing, O, R]
If
f
returns true when passed the resource of this pull, this pull is returned.If
f
returns true when passed the resource of this pull, this pull is returned. Otherwise,Pull.done
is returned.- Implicit
- This member is added by an implicit conversion from Pull[F, O, R] to Pull[Nothing, O, R] performed by method covaryPure in fs2.Pull. This conversion will take place only if F is a subclass of Pure (F <: Pure).
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(pull: Pull[Nothing, O, R]).withFilter(f)