package irmin

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

Parameters

module S : STORE

Signature

Node Graphs

type 'a t = 'a S.t

The type for store handles.

type metadata = S.Val.metadata

The type for node metadata.

type contents = S.Contents.key

The type of user-defined contents.

type node = S.key

The type for node values.

type step = S.Path.step

The type of steps. A step is used to pass from one node to another.

type path = S.Path.t

The type of store paths. A path is composed of steps.

type value = [
  1. | `Node of node
  2. | `Contents of contents * metadata
]

The type for store values.

val empty : [> `Write ] t -> node Lwt.t

The empty node.

val v : [> `Write ] t -> (step * value) list -> node Lwt.t

v t n is a new node containing n.

val list : [> `Read ] t -> node -> (step * value) list Lwt.t

list t n is the contents of the node n.

val find : [> `Read ] t -> node -> path -> value option Lwt.t

find t n p is the contents of the path p starting form n.

val add : [ `Read | `Write ] t -> node -> path -> value -> node Lwt.t

add t n p v is the node x such that find t x p is Some v and it behaves the same n for other operations.

val remove : [ `Read | `Write ] t -> node -> path -> node Lwt.t

remove t n path is the node x such that find t x is None and it behhaves then same as n for other operations.

val closure : [> `Read ] t -> min:node list -> max:node list -> node list Lwt.t

closure t min max is the unordered list of nodes n reachable from a node of max along a path which: (i) either contains no min or (ii) it ends with a min.

Note: Both min and max are subsets of n.

val iter : [> `Read ] t -> min:node list -> max:node list -> ?node:(node -> unit Lwt.t) -> ?edge:(node -> node -> unit Lwt.t) -> ?skip:(node -> bool Lwt.t) -> ?rev:bool -> unit -> unit Lwt.t

iter min max node edge skip rev () iterates in topological order over the closure of t as specified by GRAPH.closure.

It applies three functions while traversing the graph: node on the nodes; edge n predecessor_of_n on the directed edges and skip n to not include a node n, its predecessors and the outgoing edges of n.

If rev is true (the default) then the graph is traversed in the reverse order: node n is applied only after it was applied on all its predecessors; edge n p is applied after node n. Note that edge n p is applied even if p is skipped.

Value Types

val metadata_t : metadata Type.t

metadat_t is the value type for metadata.

val contents_t : contents Type.t

contents_t is the value type for contents.

val node_t : node Type.t

node_t is the value type for node.

val step_t : step Type.t

step_t is the value type for step.

val path_t : path Type.t

path_t is the value type for path.

val value_t : value Type.t

value_t is the value type for value.