package jsonaf

  1. Overview
  2. Docs
A library for parsing, manipulating, and serializing data structured as JSON

Install

Dune Dependency

Authors

Maintainers

Sources

jsonaf-v0.16.0.tar.gz
sha256=0c85230d47dcc80c428ad82e0f2cb0ecbb5048129eaa036aeeb4cfb8d9d2063f

Description

A library for parsing, manipulating, and serializing data structured as JSON.

Published: 14 Jun 2023

README

Jsonaf

This is a library for parsing, manipulating, and serializing data structured as JSON. It's built on the Angstrom and Faraday libraries. The underlying type is a simple polymorphic type:

type t =
  [ `Null
  | `False
  | `True
  | `String of string
  | `Number of string
  | `Object of (string * t) list
  | `Array of t list
  ]

Note that Number has a type of string! This is intentional, as it is left up to the user to decide how numbers should be interpreted. Certain fields might be integers while others might be floats.

The most bare-bones use case of this library is to pattern match on the type above and use the following two functions:

val of_string : string -> t
val to_string : t -> string

Jsonaf_kernel

The kernel library simply contains the type and functions to serialize and deserialize the type to a string. It has no other dependencies outside of Angstrom and Faraday.

Dependencies (6)

  1. faraday
  2. dune >= "2.0.0"
  3. angstrom >= "0.15.0"
  4. ppx_jane >= "v0.16" & < "v0.17"
  5. base >= "v0.16" & < "v0.17"
  6. ocaml >= "4.14.0"

Dev Dependencies

None

Used by (6)

  1. decoders-jsonaf
  2. hardcaml_of_verilog = "v0.16.0"
  3. of_json < "v0.17.0"
  4. ppx_jsonaf_conv = "v0.16.0"
  5. sexp = "v0.16.0"
  6. vcaml >= "v0.16.0"

Conflicts

None

OCaml

Innovation. Community. Security.