Defined as p >> p2 == p flatMap { _ => p2 }
.
Definition: p as r == p map (_ => r)
.
Interpret this Pull
to produce a Stream
.
Interpret this Pull
to produce a Stream
. The result type R
is discarded.
Consult p2
if this pull fails due to an await
on an exhausted Handle
.
Consult p2
if this pull fails due to an await
on an exhausted Handle
.
If this pull fails due to an error, p2
is not consulted.
Defined as p >> p2 == p flatMap { _ => p2 }
.
Defined as p >> p2 == p flatMap { _ => p2 }
.
(pull: Pull[Nothing, O, R]).>>(p2)(S)
Definition: p as r == p map (_ => r)
.
Definition: p as r == p map (_ => r)
.
(pull: Pull[Nothing, O, R]).as(r)
Interpret this Pull
to produce a Stream
.
Interpret this Pull
to produce a Stream
. The result type R
is discarded.
(pull: Pull[Nothing, O, R]).close
(pull: Pull[Nothing, O, R]).covary(S)
(pull: Pull[Nothing, O, R]).filter(f)
(pull: Pull[Nothing, O, R]).flatMap(f)
(pull: Pull[Nothing, O, R]).map(f)
(pull: Pull[Nothing, O, R]).optional
Consult p2
if this pull fails due to an await
on an exhausted Handle
.
Consult p2
if this pull fails due to an await
on an exhausted Handle
.
If this pull fails due to an error, p2
is not consulted.
(pull: Pull[Nothing, O, R]).or(p2)(S1, R2)
(pull: Pull[Nothing, O, R]).toString()
(pull: Pull[Nothing, O, R]).withFilter(f)
A pull allows acquiring elements from a stream in a resource safe way, emitting elements of type
O
, working with a resource of typeR
, and evaluating effects of typeF
.Laws:
or
forms a monoid in conjunction withdone
:or(done, p) == p
andor(p, done) == p
.or(or(p1,p2), p3) == or(p1, or(p2,p3))
fail
is caught byonError
:onError(fail(e))(f) == f(e)
Pull
forms a monad withpure
andflatMap
:pure >=> f == f
f >=> pure == f
(f >=> g) >=> h == f >=> (g >=> h)
wheref >=> g
is defined asa => a flatMap f flatMap g