Module Jsont.Sort

Sorts of JSON values.

type t =
  1. | Null
    (*

    Nulls

    *)
  2. | Bool
    (*

    Booleans

    *)
  3. | Number
    (*

    Numbers

    *)
  4. | String
    (*

    Strings

    *)
  5. | Array
    (*

    Arrays

    *)
  6. | Object
    (*

    Objects

    *)

The type for sorts of JSON values.

val to_string : t -> string

to_string s is a string for sort s.

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

pp formats sorts.

Kinds

For formatting error messages.

val or_kind : kind:string -> t -> string

or_kind ~kind s is to_string s if kind is "" and kind otherwise.

val kinded : kind:string -> t -> string

kinded ~kind s is to_string s if kind is "" and String.concat " " [kind; to_string s] otherwise.

val kinded' : kind:string -> string -> string

kinded' ~kind sort is sort if kind is "" and String.concat " " [kind; sort] otherwise.