package melange

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Provide utilities for json

Efficient JSON encoding using JavaScript API

type t
type _ kind =
  1. | String : string kind
  2. | Number : float kind
  3. | Object : t Js__.Js_dict.t kind
  4. | Array : t array kind
  5. | Boolean : bool kind
  6. | Null : Js__.Js_types.null_val kind
type tagged_t =
  1. | JSONFalse
  2. | JSONTrue
  3. | JSONNull
  4. | JSONString of string
  5. | JSONNumber of float
  6. | JSONArray of t array
val classify : t -> tagged_t
val test : 'a -> 'a0 kind -> bool
val decodeString : t -> string option
val decodeNumber : t -> float option
val decodeObject : t -> t Js__.Js_dict.t option
val decodeArray : t -> t array option
val decodeBoolean : t -> bool option
val decodeNull : 'a -> 'b Js__.Js_internal.null option
val parseExn : string -> t
val stringifyAny : 'a -> string option
val null : t
val string : string -> t
val number : float -> t
val boolean : bool -> t
val object_ : t Js__.Js_dict.t -> t
val array : t array -> t
val stringArray : string array -> t
val numberArray : float array -> t
val booleanArray : bool array -> t
val objectArray : t Js__.Js_dict.t array -> t
val stringify : t -> string
val stringifyWithSpace : t -> int -> string
val patch : 'a -> 'b
val serializeExn : 't -> string
val deserializeUnsafe : string -> 'a
OCaml

Innovation. Community. Security.