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) result

Monad for synchronous 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_result : ('a, Error.t) result -> 'a t
val check_tree_invariant : unit t

For debugging. Check the invariant of the current tree.

val fail : Fs_tree.error -> 'a t

Fail with the given error

val raw_cursor : Fs_tree.raw_cursor t

Get the current underlying raw cursor

val copy : Fs_types.Path.t -> Fs_types.Path.t -> unit t

copy src dst sets the tree at src to dst. dst must not be empty.

Regular file read access.

val write : Fs_types.Path.t -> Value.t -> unit t

Create or update a regular file. Directories are created if necessary. The path must not be empty.

val rm : ?recursive:bool -> ?ignore_error:bool -> Fs_types.Path.t -> bool t

Remove a regular file or a directory. The path must not be empty.

recursive=false : fails when the target is a directory recursive=true : removes the target recursively if it is a directory ignore_error=false : fails when the target does not exist ignore_error=true : does not fail even if the target does not exist

Returns true if the target is really removed. Returns false if the target does not exist.

val rmdir : ?ignore_error:bool -> Fs_types.Path.t -> bool t

Recursive removal of a directory. The path must not be empty.

ignore_error=false : fails when the target does not exist ignore_error=true : does not fail even if the target does not exist

Returns true if the target is really removed. Returns false if the target does not exist.

val compute_hash : Fs_types.Path.t -> Fs_tree.hash t

Compute the Merkle hash of the tree specified by the path

val may_forget : Fs_types.Path.t -> unit t

Clear the memory cache of the tree under the current tree, if it is already persisted on the disk.

Get the subtree of the specified path. It also returns the view of the subtree.

val set_tree : Fs_types.Path.t -> Fs_tree.tree -> unit t

Set the tree at the specified path

val tree : Fs_tree.tree t

Get the cursor for `Fs` module

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

Monad runner

val do_then : (Fs_tree.tree -> unit) -> 'a t -> 'a t

For debugging. do_then f op executes f against the current tree, then performs op.