package caqti
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Unified interface to relational database libraries
Install
dune-project
Dependency
Authors
Maintainers
Sources
caqti-v2.3.2.tbz
sha256=8f6c1724b59ac22a5c657c9e53b9a1706e39ecd462e82958b0cea88e43f0aba7
sha512=75b968ab37ae94cadcaabbcce0f91b1ffa4334ed69e441bdeb823077eb7675264282efb0fab3baaaad446582cfb427769e19f22c8c194a316ac2248c3fba5cf8
doc/src/caqti/caqti_stream_sig.ml.html
Source file caqti_stream_sig.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81(* Copyright (C) 2022--2026 Petter A. Urkedal <paurkedal@gmail.com> * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version, with the LGPL-3.0 Linking Exception. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * and the LGPL-3.0 Linking Exception along with this library. If not, see * <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *) (** Concurrent stream signature. *) module type S = sig type +'a fiber type ('a, 'err) t = unit -> ('a, 'err) node fiber (** A stream, represented as a lazy chain of {!Cons}-nodes terminating in a {!Nil} or an {!Error}. *) and ('a, 'err) node = | Nil (** The node of an empty stream *) | Error of 'err (** A node of a permanently failed stream. *) | Cons of 'a * ('a, 'err) t (** A node holding the next element and continuation of a stream. *) val empty : ('a, 'err) t (** [empty] is the empty stream, i.e. it immediately returns {!Nil}. *) val error : 'err -> ('a, 'err) t (** [error err] is a stream which fails immediately with [err]. *) val fold : f: ('a -> 'state -> 'state) -> ('a, 'err) t -> 'state -> ('state, 'err) result fiber (** [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 fiber) -> ('a, 'clog) t -> 'state -> ('state, [> `Congested of 'clog ] as 'err) result fiber (** [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 fiber) -> ('a, 'clog) t -> (unit, [> `Congested of 'clog ] as 'err) result fiber (** [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. *) val to_rev_list : ('a, 'err) t -> ('a list, 'err) result fiber (** [to_rev_list stream] consumes the remainder of [stream], returning a list of its element in reverse order of production. *) val to_list : ('a, 'err) t -> ('a list, 'err) result fiber (** [to_list stream] consumes the remainder of [stream], returning a list of its element in order of production. *) val of_list : 'a list -> ('a, 'err) t (** [of_list xs] is a non-failing finite stream (re)producing the elements [xs] in order of occurrence. *) val map_result : f: ('a -> ('b, 'err) result) -> ('a, 'err) t -> ('b, 'err) t end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>