Module Fehu.Value

Universal value type.

Values represent heterogeneous data flowing through spaces and info dictionaries. Each variant wraps one kind of scalar, array, or composite datum.

Types

type t =
  1. | Null
    (*

    No value.

    *)
  2. | Bool of bool
    (*

    A boolean.

    *)
  3. | Int of int
    (*

    An integer.

    *)
  4. | Float of float
    (*

    A float.

    *)
  5. | String of string
    (*

    A string.

    *)
  6. | Int_array of int array
    (*

    An integer array.

    *)
  7. | Float_array of float array
    (*

    A float array.

    *)
  8. | Bool_array of bool array
    (*

    A boolean array.

    *)
  9. | List of t list
    (*

    A heterogeneous list.

    *)
  10. | Dict of (string * t) list
    (*

    A string-keyed association list.

    *)

The type for universal values.

Predicates

val equal : t -> t -> bool

equal a b is true iff a and b are structurally equal.

Formatting

val pp : Stdlib.Format.formatter -> t -> unit

pp formats a value for debugging.

val to_string : t -> string

to_string v is v formatted as a string via pp.