package irmin

  1. Overview
  2. Docs
On This Page
  1. Path
Legend:
Library
Module
Module type
Parameter
Class
Class type

The type for store paths.

Path

type t

The type for path values.

include Hum.S with type t := t
include Tc.S0 with type t := t
val equal : t Tc.equal
val compare : t Tc.compare
val hash : t Tc.hash
val to_json : t Tc.to_json

The REST inteface.

val of_json : t Tc.of_json
val size_of : t Tc.size_of

The serialization format.

val write : t Tc.writer
val read : t Tc.reader
val to_hum : t -> string

Display a value using its human readable representation.

val of_hum : string -> t

Convert a human readable representation of a value into its abstract value.

  • raises Invalid_argument

    if the string does not represent anything meaningful.

type step

Type type for path's steps.

val empty : t

The empty path.

val create : step list -> t

Create a path from a list of steps.

val is_empty : t -> bool

Check if the path is empty.

val cons : step -> t -> t

Prepend a step to the path.

val rcons : t -> step -> t

Append a step to the path.

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

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

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

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

val map : t -> (step -> 'a) -> 'a list
module Step : Path.STEP with type t = step
OCaml

Innovation. Community. Security.