package tezos-lwt-result-stdlib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type (+'a, 'e) node =
  1. | Nil
  2. | Cons of 'a * ('a, 'e) t

This is similar to Seq.S.t but the suspended node is a promised result.

Similarly to Seq_e, sequences of this module can be interrupted by an error. In this case, traversal has fully applied to the successful prefix before the returned promise evaluates to Error _.

and ('a, 'e) t = unit -> (('a, 'e) node, 'e) result Lwt.t
val empty : ('a, 'e) t
val nil : ('a, 'e) node
val cons : 'a -> ('a, 'e) t -> ('a, 'e) t
val cons_s : 'a Lwt.t -> ('a, 'e) t -> ('a, 'e) t
val cons_e : ('a, 'e) result -> ('a, 'e) t -> ('a, 'e) t
val cons_es : ('a, 'e) result Lwt.t -> ('a, 'e) t -> ('a, 'e) t
val append : ('a, 'e) t -> ('a, 'e) t -> ('a, 'e) t
val return : 'a -> ('a, 'e) t
val return_e : ('a, 'e) result -> ('a, 'e) t
val return_s : 'a Lwt.t -> ('a, 'e) t
val return_es : ('a, 'e) result Lwt.t -> ('a, 'e) t
val interrupted : 'e -> ('a, 'e) t
val interrupted_s : 'e Lwt.t -> ('a, 'e) t
val first : ('a, 'e) t -> ('a, 'e) result option Lwt.t
val fold_left : ('a -> 'b -> 'a) -> 'a -> ('b, 'e) t -> ('a, 'e) result Lwt.t
val fold_left_e : ('a -> 'b -> ('a, 'e) result) -> 'a -> ('b, 'e) t -> ('a, 'e) result Lwt.t

See Seq_e.fold_left_e for a warning about traversal and interruption errors being indistinguishable. This applies to all _e and _es functions of this module.

val fold_left_s : ('a -> 'b -> 'a Lwt.t) -> 'a -> ('b, 'e) t -> ('a, 'e) result Lwt.t
val fold_left_es : ('a -> 'b -> ('a, 'e) result Lwt.t) -> 'a -> ('b, 'e) t -> ('a, 'e) result Lwt.t
val iter : ('a -> unit) -> ('a, 'e) t -> (unit, 'e) result Lwt.t
val iter_e : ('a -> (unit, 'e) result) -> ('a, 'e) t -> (unit, 'e) result Lwt.t
val iter_s : ('a -> unit Lwt.t) -> ('a, 'e) t -> (unit, 'e) result Lwt.t
val iter_es : ('a -> (unit, 'e) result Lwt.t) -> ('a, 'e) t -> (unit, 'e) result Lwt.t
val map : ('a -> 'b) -> ('a, 'e) t -> ('b, 'e) t
val map_e : ('a -> ('b, 'e) result) -> ('a, 'e) t -> ('b, 'e) t
val map_s : ('a -> 'b Lwt.t) -> ('a, 'e) t -> ('b, 'e) t
val map_es : ('a -> ('b, 'e) result Lwt.t) -> ('a, 'e) t -> ('b, 'e) t
val map_error : ('e -> 'f) -> ('a, 'e) t -> ('a, 'f) t
val map_error_s : ('e -> 'f Lwt.t) -> ('a, 'e) t -> ('a, 'f) t
val filter : ('a -> bool) -> ('a, 'e) t -> ('a, 'e) t
val filter_e : ('a -> (bool, 'e) result) -> ('a, 'e) t -> ('a, 'e) t
val filter_s : ('a -> bool Lwt.t) -> ('a, 'e) t -> ('a, 'e) t
val filter_es : ('a -> (bool, 'e) result Lwt.t) -> ('a, 'e) t -> ('a, 'e) t
val filter_map : ('a -> 'b option) -> ('a, 'e) t -> ('b, 'e) t
val filter_map_e : ('a -> ('b option, 'e) result) -> ('a, 'e) t -> ('b, 'e) t
val filter_map_s : ('a -> 'b option Lwt.t) -> ('a, 'e) t -> ('b, 'e) t
val filter_map_es : ('a -> ('b option, 'e) result Lwt.t) -> ('a, 'e) t -> ('b, 'e) t
val unfold : ('b -> ('a * 'b) option) -> 'b -> ('a, 'e) t
val unfold_s : ('b -> ('a * 'b) option Lwt.t) -> 'b -> ('a, 'e) t
val unfold_e : ('b -> (('a * 'b) option, 'e) result) -> 'b -> ('a, 'e) t
val unfold_es : ('b -> (('a * 'b) option, 'e) result Lwt.t) -> 'b -> ('a, 'e) t
val of_seq : 'a Seq.t -> ('a, 'e) t
val of_seq_s : 'a Lwt.t Seq.t -> ('a, 'e) t
val of_seqs : 'a Seq_s.t -> ('a, 'e) t
val of_seq_e : ('a, 'e) result Seq.t -> ('a, 'e) t
val of_seqe : ('a, 'e) Seq_e.t -> ('a, 'e) t
val of_seq_es : ('a, 'e) result Lwt.t Seq.t -> ('a, 'e) t
OCaml

Innovation. Community. Security.