package jsont

  1. Overview
  2. Docs
Declarative JSON data manipulation for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

jsont-0.1.1.tbz
sha512=e3f403d12283ac932b08254bf5d5debd3dbec1c9022e21f69b1be3fb74727da3ae7d26510eba6770451a6c711987884d93a3ee5baa94ca3a07166ad779206da5

doc/jsont/Jsont/Object/Case/index.html

Module Object.Case

Case objects.

Case objects are used to describe objects whose members depend on the tag value of a distinguished case member. See an example.

Maps

type 'a jsont := 'a t
type ('cases, 'case, 'tag) map

The type for mapping a case object represented by 'case belonging to a common type represented by 'cases depending on the value of a case member of type 'tag.

val map : ?dec:('case -> 'cases) -> 'tag -> 'case jsont -> ('cases, 'case, 'tag) map

map ~dec v obj defines the object map obj as being the case for the tag value v of the case member. dec indicates how to inject the object case into the type common to all cases.

Raises Invalid_argument if obj is not a direct result of finish, that is if obj does not describe an object.

Cases

type ('cases, 'tag) t

The type for a case of the type 'cases. This is map with its 'case representation hidden.

val make : ('cases, 'case, 'tag) map -> ('cases, 'tag) t

make map is map as a case.

Case values

type ('cases, 'tag) value

The type for case values. This holds a case value and its case map map. Use value to construct them.

val value : ('cases, 'case, 'tag) map -> 'case -> ('cases, 'tag) value

value map v is a case value v described by map.

OCaml

Innovation. Community. Security.