package pidgin

  1. Overview
  2. Docs

Module Driver.EzjsonmSource

Dealing with the Ezjonm format (which is also used, notably, by YAML).

Sourcetype t = [
  1. | `Null
  2. | `Bool of bool
  3. | `Float of float
  4. | `String of string
  5. | `A of t list
  6. | `O of (string * t) list
]

Since Ezjsonm use polymoprhic variant as a type definiton, we do not depend on the library to support it.

include SOURCE with type t := t
Sourceval translate_to_pidgin : t -> Repr.t

translate_to_pidgin source must construct a valid Pidgin value (Repr.t) from a source. Error handling is left to the consumer, even though, in an ideal world, we would want to be able to fill any value to Pidgin constructors.

include TARGET with type t := t
Sourceval translate_from_pidgin : Repr.t -> t

translate_from_pidgin repr must construct a valid expression from Repr.t to the target. Error handling is left to the consumer, even though, in an ideal world, we would want to be able to fill any value to the target constructors.