package caqti
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=483a535f41e2641917fc1832ce4ad15ffc3f4e8283b1b3018a2617349583090a
sha512=6a1222c0c55cb16a9d409980f9f2400340689b87e21aafed2d7459fd7feaeb109c2dfaf77f55f8422fbb7d3772342565ced7fed78a7b77af5aedab5bfd5ae882
doc/caqti.blocking/Caqti_blocking/Stream/index.html
Module Caqti_blocking.Stream
Source
fold ~f stream acc
consumes the remainder elements e1
, ..., eN
of stream
and returns Ok (acc |> f e1 |> ... |> f eN)
if no error occurred
val fold_s :
f:('a -> 'state -> ('state, 'err) result) ->
('a, 'clog) t ->
'state ->
('state, [> `Congested of 'clog ] as 'err) result
fold_s ~f stream acc
consumes the remainder of stream
, passing each element in order to f
along with the latest accumulation starting at acc
, and returning the final accumulation if successful. An error result may be due to either the stream provider or the callback, as distinguished with the `Congested
constructor.
val iter_s :
f:('a -> (unit, 'err) result) ->
('a, 'clog) t ->
(unit, [> `Congested of 'clog ] as 'err) result
iter_s ~f stream
consumes the remainder of stream
, passing each element in order to f
. An error result may be due to either the steram provider or the callback, as distinguished with the `Congested
constructor.
to_rev_list stream
consumes the remainder of stream
, returning a list of its element in reverse order of production.
to_list stream
consumes the remainder of stream
, returning a list of its element in order of production.
of_list xs
is a non-failing finite stream (re)producing the elements xs
in order of occurrence.