package jhupllib

  1. Overview
  2. Docs

This module contains utility functions for writing Yojson codec generators.

val list_to_yojson : ('t -> Yojson.Safe.t) -> 't list -> Yojson.Safe.t

Provides a serialization mechanism for a list data structure.

val set_to_yojson : ('t -> Yojson.Safe.t) -> ('s -> 't Batteries.Enum.t) -> 's -> Yojson.Safe.t

Provides a serialization mechanism for a set data structure.

val map_to_yojson : ('k -> Yojson.Safe.t) -> ('v -> Yojson.Safe.t) -> ('m -> ('k * 'v) Batteries.Enum.t) -> 'm -> Yojson.Safe.t

Provides a serialization mechanism for a map data structure.

module type To_yojson_type = sig ... end

The type of modules which give a Yojson serializer.

module Set_to_yojson (S : Batteries.Set.S) (Y : To_yojson_type with type t = S.elt) : sig ... end

A functor which generates a Yojson serializer for an existing functorized set module.

module Map_to_yojson (M : Batteries.Map.S) (Y : To_yojson_type with type t = M.key) : sig ... end

A functor which generates a Yojson serializer for an existing functorized map module.

OCaml

Innovation. Community. Security.