package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-libs.base/Tezos_base/Bounded/Int16/index.html

Module Bounded.Int16Source

Allows to build interval of int integers representable on 2 bytes. The encoding used is Data_encoding.int16 regardless of the actual bounds.

  • raises Invalid_argument

    if the bounds provided cannot be representable on 2 bytes.

Parameters

module B : BOUNDS with type ocaml_type := int

Signature

Sourcetype t

Internal representation of a bounded value.

include BOUNDS with type ocaml_type := int
val min_value : int

min_value represents the minimal value (included) reprensatable.

val max_value : int

max_value represents the maximal value (included) reprensatable.

include Tezos_stdlib.Compare.S with type t := t
Sourceval (=) : t -> t -> bool

x = y iff compare x y = 0

Sourceval (<>) : t -> t -> bool

x <> y iff compare x y <> 0

Sourceval (<) : t -> t -> bool

x < y iff compare x y < 0

Sourceval (<=) : t -> t -> bool

x <= y iff compare x y <= 0

Sourceval (>=) : t -> t -> bool

x >= y iff compare x y >= 0

Sourceval (>) : t -> t -> bool

x > y iff compare x y > 0

Sourceval compare : t -> t -> int

compare an alias for the functor parameter's compare function

Sourceval equal : t -> t -> bool

equal x y iff compare x y = 0

Sourceval max : t -> t -> t

max x y is x if x >= y otherwise it is y

Sourceval min : t -> t -> t

min x y is x if x <= y otherwise it is y

Sourceval encoding : t Data_encoding.t

A (partial) encoding of the datatype. If the encoded value is out of bounds, an exception may be raised. See Data_encoding.conv_with_guard.

Sourceval pp : Format.formatter -> t -> unit

A pretty-printer for values of type t.

Sourceval to_value : t -> int

to_value t is a projection to the OCaml representation of the bounded value t.

Sourceval of_value : int -> t option

of_value ocaml_value represents ocaml_value as a bounded value. Returns None if the value is outside of the bounds specified by min_value and max_value.

OCaml

Innovation. Community. Security.