package irmin
Parameters
module C : Contents.STORE
Signature
Node Graphs
type contents = C.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.
Create a new node.
contents t n s
is n
's contents in t
, associated to the step s
.
succ t n s
is n
's successors in t
, associated to the step s
.
iter_contents f fn
calls fn
on t
's contents.
iter_succ t fn
calls fn
on t
's successors.
Contents
mem_contents t n path
checks if there is a path labeled by path
from n
to a valid contents in t
.
read_contents t n path
is the contents at the end of the path starting from n
and labeled by path
in t
. Return None
if no such contents exists.
Same as read_contents
but raises Invalid_argument
if there is no valid contents.
add_contents t n path c
adds the contents c
as the end of the path starting from n
and labeled by path
in t
.
remove_contents t n path
removes the contents at the end of the path starting from n
and labeled by path
in t
.
Nodes
mem_node t n
checks if there is a path labeled by path
from n
to a valid node in t
.
read_node t n path
is the node at the end of the path starting from n
and labeled by path
in t
. Return None
if no such node exists.
Same as read_node but raise Invalid_argument
if the path is invalid.
add_node t n path c
adds the node c
as the end of the path starting from n
and labeled by path
in t
.
remove_node t n path
removes the node at the end of the path of the path starting from n
and labeled by path
in t
.
closure t ~min ~max
is the transitive closure c
of t
's nodes such that:
- There is a path in
t
from any nodes inmin
to nodes inc
. Ifmin
is empty, that condition is always true. - There is a path in
t
from any nodes inc
to nodes inmax
. Ifmax
is empty, that condition is always false.
B Note:
Both min
and max
are subsets of c
.