Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
The Stream
module provides an abstraction to GitHub's paginated endpoints. Stream creation does not initiate any network activity. When requests are made, results are buffered internally. Streams are not mutable.
type 'a parse = string -> 'a list Lwt.t
'a parse
is the type of functions which extract elements from a paginated response.
next s
is the next element of the stream and a stream continuation if one exists. The input stream is not modified. This function offers an efficient, lazy, and uniform means to iterate over ordered API results which may be too numerous to fit into a single request/response pair.
map f s
is the lazy stream of f
applied to elements of s
as they are demanded.
fold f a s
is the left fold of f
over the elements of s
with a base value of a
. Warning: this function may result in many successive API transactions.
find p s
is the first value in s
satisfying p
if one exists and a stream continuation for further ingestion.
iter f s
is activated after the application of f
to each element of s
.
to_list s
is a list with each element of s
. Warning: this function may result in many successive API transactions.
val of_list : 'a list -> 'a t
of_list l
is a stream with each element of l
. Occasionally, it is useful to write interfaces which operate generically on streams. of_list
allows you to use list values with those interfaces.