plebeia

Merkle Patricia tree implementation
Library plebeia
Module Plebeia . Internal . Index
type t

2 Constants

The zero index is treated specially.

val zero : t
val one : t
val max_int : t
val zero_then_none : t -> t option

This function returns None if t is zero.

2 Arithmetics

val pred : t -> t
val succ : t -> t
val (-) : t -> t -> t
val (+) : t -> t -> t
val (*) : t -> t -> t
val (/) : t -> t -> t
val compare : t -> t -> int

2 Conversion to integer types

val to_int32 : t -> int32
val of_int32 : int32 -> t
val to_int64 : t -> int64
val of_int64 : int64 -> t
val of_int : int -> t
val to_int : t -> int

Be careful to use it in the 32-bit arch, where OCaml's int is 31-bits, since t is unsigned 32bit integer.

val of_uint32 : Stdint.Uint32.t -> t
val to_uint32 : t -> Stdint.Uint32.t

2 Set and Map

module Set : Set.S with type elt = t
module Map : Map.S with type key = t