package mechaml

  1. Overview
  2. Docs

The List module wraps the functions of the Lwt_list module inside the Agent monad. Functions suffixed with _s chain the actions sequentially, passing around the updated agent from an action to the next one. The functions suffixed with _m do everything in parallel, using a copy of the initial state in every thread and returning this same original state. The latter can be useful to retrieve a bunch of resources in batch where the updated state is not of interest (e.g download images)

val iter_s : ('a -> unit m) -> 'a list -> unit m
val iter_p : ('a -> unit m) -> 'a list -> unit m
val iteri_s : (int -> 'a -> unit m) -> 'a list -> unit m
val iteri_p : (int -> 'a -> unit m) -> 'a list -> unit m
val map_s : ('a -> 'b m) -> 'a list -> 'b list m
val map_p : ('a -> 'b m) -> 'a list -> 'b list m
val mapi_s : (int -> 'a -> 'b m) -> 'a list -> 'b list m
val mapi_p : (int -> 'a -> 'b m) -> 'a list -> 'b list m
val fold_left_s : ('a -> 'b -> 'a m) -> 'a -> 'b list -> 'a m
val fold_right_s : ('a -> 'b -> 'b m) -> 'a list -> 'b -> 'b m
OCaml

Innovation. Community. Security.