package irmin-http

  1. Overview
  2. Docs

Key provides base functions for the stores's paths.

Path

type t = key

The type for path values.

val pp : t Fmt.t

pp is the pretty-printer for paths.

val of_string : string -> (t, [ `Msg of string ]) Result.result

of_string parses paths.

type step = step

Type type for path's steps.

val empty : t

The empty path.

val v : 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

map t f maps f over all steps of t.

val pp_step : step Fmt.t

pp_step is pretty-printer for path steps.

val step_of_string : string -> (step, [ `Msg of string ]) Result.result

step_of_string parses path steps.

Value Types

val t : t Irmin.Type.t

t is the value type for t.

val step_t : step Irmin.Type.t

step_t is the value type for step.

OCaml

Innovation. Community. Security.