Module Brassaia_eio.Path

Tree path handling.

Path

type step = string

Type type for path's steps.

val compare_step : step -> step -> int
val pp_step : Stdlib.Format.formatter -> step -> unit
val step_to_bin_string : step -> string
val step_of_bin_string : string -> (step, [ `Msg of string ]) Stdlib.result
type t = step list

The type for path values.

val compare : t -> t -> int
val pp : Stdlib.Format.formatter -> t -> unit
val empty : t

The empty path.

val init : step list -> t

Creates a path from a list of steps.

val is_empty : t -> bool

Check if the path is empty.

val cons : step -> t -> t

Prepends a step to the path.

val rcons : t -> step -> t

Append a step to the path.

val decons : t -> (step * t) option

Deconstructs the first element of the path. Return None if the path is empty.

val rdecons : t -> (t * step) option

Deconstructs the last element of the path. Return None if the path is empty.

val map : t -> (step -> 'a) -> 'a list

map t f maps f over all steps of t.

Value Types

val t : t Type.t

t is the value type for t.

val encoding : t Data_encoding.t

encoding is the data_encoding for t.

val step_t : step Type.t

step_t is the value type for step.

val step_encoding : step Data_encoding.t

step_encoding is the data_encoding for step.