123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)(** The [S] signature is similar to {!Seq.S} except that suspended nodes are
wrapped in a promise.
This allows some additional traversors ([S.map], etc.) to be applied lazily.
The functions [of_seq] and [of_seq_s] allow conversion from vanilla
sequences. *)moduletypeS=sig(** This is similar to [S.t] but the suspended node is a promise. *)type+'anode=Nil|Consof'a*'atand'at=unit->'anodeLwt.tincludeSeqes.Sigs.SEQMON1ALLwithtype'amon:='aLwt.twithtype'at:='atmoduleE:Seqes.Sigs.SEQMON2TRAVERSORSwithtype('a,'e)mon:=('a,'e)resultLwt.twithtype('a,'e)callermon:=('a,'e)resultwithtype('a,'e)t:='atmoduleS:Seqes.Sigs.SEQMON1TRANSFORMERSwithtype'amon:='aLwt.twithtype'acallermon:='aLwt.twithtype'at:='atmoduleES:Seqes.Sigs.SEQMON2TRAVERSORSwithtype('a,'e)mon:=('a,'e)resultLwt.twithtype('a,'e)callermon:=('a,'e)resultLwt.twithtype('a,'e)t:='at(** [return_s p] is a sequence with the value the promise [p] resolves to as
its single element. *)valreturn_s:'aLwt.t->'at(** [cons_s p s] is the sequence containing the value the promise [p] resolves
to, followed by [s]. *)valcons_s:'aLwt.t->'at->'at(** Similar to {!iter} but wraps the iteration in {!Lwt}. The
steps of the iteration are started concurrently: one iteration is started
as soon as the node becomes resolved. The promise [iter_p f s]
is resolved only once all the promises of the iteration are. At this point
it is either fulfilled if all promises are, or rejected if at least one of
them is. *)valiter_p:('a->unitLwt.t)->'at->unitLwt.t(** Similar to {!iteri} but wraps the iteration in {!Lwt}. All the
steps of the iteration are started concurrently. The promise [iteri_p f s]
is resolved only once all the promises of the iteration are. At this point
it is either fulfilled if all promises are, or rejected if at least one of
them is. *)valiteri_p:(int->'a->unitLwt.t)->'at->unitLwt.tvaltake:when_negative_length:'err->int->'at->('at,'err)resultvaldrop:when_negative_length:'err->int->'at->('at,'err)resultvalof_seq:'aStdlib.Seq.t->'atvalof_seq_s:'aLwt.tStdlib.Seq.t->'atend