aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Path.mli
blob: e95505df307103fe401ed1de773b0509b99a0f1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
type t

val this : t
val ( @/ ) : string -> t -> t
val of_list : string list -> t
val to_list : t -> string list
val to_string : t -> string
val lookup : Protocols.Handle.t -> t -> (Protocols.Handle.t, Concepts.Condition.condition) result

(** what [path] reaches, or [None] when some part of it is not there. *)
val find :
  Protocols.Handle.t -> t -> (Protocols.Handle.t option, Concepts.Condition.condition) result

val update :
  Protocols.Handle.t ->
  t ->
  string ->
  Protocols.Handle.t option ->
  Protocols.Handle.t option ->
  (bool, Concepts.Condition.condition) result

(** [assoc handle path key value] derives [handle] with [key] under
    [path] bound to [value], or unbound when [None]. *)
val assoc :
  Protocols.Handle.t ->
  t ->
  string ->
  Protocols.Handle.t option ->
  (Protocols.Handle.t, Concepts.Condition.condition) result

(** every change of [assoc] at once: each object on the way is derived
    once, so the changes to a branch land as one successor state. An
    object on the way that is not there yet is handed to its parent as a
    directory of what the changes put in it. *)
val assoc_all :
  Protocols.Handle.t ->
  (t * string * Protocols.Handle.t option) list ->
  (Protocols.Handle.t, Concepts.Condition.condition) result

(** the paths, relative to [a] and [b], that differ between them. Equal
    addresses are not descended, so this costs what changed. Every child
    is compared, so diff a branch's \multigroup rather than the branch,
    whose \previous differs whenever anything does. *)
val diff : Protocols.Handle.t -> Protocols.Handle.t -> (t list, Concepts.Condition.condition) result