package plebeia

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t = Fs_tree.tree -> (Fs_tree.tree * 'a, Error.t) Stdlib.result Lwt.t

Monad for asynchronous file system operations

include Monad.S1 with type 'a t := 'a t
val return : 'a -> 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val map : ('a -> 'b) -> 'a t -> 'b t
val mapM : ('a -> 'b t) -> 'a list -> 'b list t
val mapM_ : ('a -> unit t) -> 'a list -> unit t
val iterM : ('a -> unit t) -> 'a list -> unit t

alias of mapM_

val fold_leftM : ('a -> 'b -> 'a t) -> 'a -> 'b list -> 'a t
val parseM : ('a -> 'b list -> ('a * 'b list) t) -> 'a -> 'b list -> 'a t
module Infix : sig ... end
module Syntax : sig ... end
val lift : 'a Fs_tree.Op.t -> 'a t

Convert Op monad to Op_lwt

val lift_op : 'a Fs_tree.Op.t -> 'a t
val lift_lwt : 'a Lwt.t -> 'a t

Monad lifters

val lift_result : ('a, Error.t) Stdlib.result -> 'a t
val lift_result_lwt : ('a, Error.t) Stdlib.result Lwt.t -> 'a t
val fail : Fs_tree.error -> 'a t

Lifted versions of Op functions

val raw_cursor : Fs_tree.raw_cursor t
val copy : Fs_types.Path.t -> Fs_types.Path.t -> unit t
val write : Fs_types.Path.t -> Value.t -> unit t
val rm : ?recursive:bool -> ?ignore_error:bool -> Fs_types.Path.t -> bool t
val rmdir : ?ignore_error:bool -> Fs_types.Path.t -> bool t
val compute_hash : Fs_types.Path.t -> Fs_tree.hash t
val may_forget : Fs_types.Path.t -> unit t
val set_tree : Fs_types.Path.t -> Fs_tree.tree -> unit t
val tree : Fs_tree.tree t
val do_then : (Fs_tree.tree -> unit) -> 'a t -> 'a t
val fold : 'a -> Fs_types.Path.t -> ('a -> Fs_types.Path.t -> Fs_tree.tree -> ([ `Continue | `Exit | `Up ] * 'a, Error.t) Stdlib.result Lwt.t) -> 'a t

Folding

  • `Continue: if the item is a directory, its items are recursively folded
  • `Up: if the item is a directory, its items are skipped
  • `Exit: terminate the folding immediately and returns the accumulator as the final result of fold
val fold' : ?depth:[ `Eq of int | `Ge of int | `Gt of int | `Le of int | `Lt of int ] -> 'a -> Fs_types.Path.t -> ('a -> Fs_types.Path.t -> Fs_tree.tree -> ('a, Error.t) Stdlib.result Lwt.t) -> 'a t

Folding with a depth specification

List the directory specified by the path

val ls2 : offset:int -> length:int -> Fs_types.Path.t -> (Fs_tree.name * Fs_tree.tree) list t
val count : Fs_types.Path.t -> int t

count the leaves and buds, loading nodes on demand.

count path, if path points to a Bud, it returns the number of the leaves and buds under path.

val run : Fs_tree.tree -> 'a t -> (Fs_tree.tree * 'a, Error.t) Stdlib.result Lwt.t

Monad runner

OCaml

Innovation. Community. Security.