package plebeia

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Make.OpSource

Sourcetype 'a t = tree -> (tree * 'a, Error.t) result

Monad for synchronous file system operations

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

alias of mapM_

Sourceval fold_leftM : ('a -> 'b -> 'a t) -> 'a -> 'b list -> 'a t
Sourceval parseM : ('a -> 'b list -> ('a * 'b list) t) -> 'a -> 'b list -> 'a t
Sourcemodule Infix : sig ... end
Sourcemodule Syntax : sig ... end
Sourceval lift_result : ('a, Error.t) result -> 'a t
Sourceval check_tree_invariant : unit t

For debugging. Check the invariant of the current tree.

Sourceval fail : error -> 'a t

Fail with the given error

Sourceval raw_cursor : raw_cursor t

Get the current underlying raw cursor

Sourceval copy : Path.t -> Path.t -> unit t

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

Sourceval cat : Path.t -> Value.t t

Regular file read access.

Sourceval write : Path.t -> Value.t -> unit t

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

Sourceval rm : ?recursive:bool -> ?ignore_error:bool -> 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.

Sourceval rmdir : ?ignore_error:bool -> 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.

Sourceval compute_hash : Path.t -> hash t

Compute the Merkle hash of the tree specified by the path

Sourceval may_forget : Path.t -> unit t

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

Sourceval get_tree : Path.t -> (tree * view) t

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

Sourceval set_tree : Path.t -> tree -> unit t

Set the tree at the specified path

Sourceval cursor : cursor t

Get the cursor for `Fs` module

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

Monad runner

Sourceval do_then : (tree -> unit) -> 'a t -> 'a t

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