package pidgin
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9f05aa80a2867cc15fabbf6d52239567d2d3b386c611dc0467c27799526e5bfc
sha512=42ae7eefe12dfba69266a1e4a19a36c7e4000a30325d222cff8f95fafb011d886b455f3aef0553c4de40d0f7d23455fdbbcca9a273a7095ca6f9d6e999e7aba7
doc/pidgin/Pidgin/index.html
Module PidginSource
Pidgin is a generic key-value data structure description language that enables fine-grained validation to deal with format like JSON, S-expression, Yaml, ToML etc.
The main idea is to present a minimal representation (very similar to that of JSON) and to provide:
- a DSL for describing arbitrary data structures in this language (see
Repr). - Validation functions that operate on data described using this DSL (see
Check). ReprandCheckcan be combined usingPrism.- A bidirectional conversion approach (see
Driver), imposing a cost due to the indirect nature of the generic format (though it is viable in many scenarios).
Pidgin does not statically preserve the type of expressions; instead, it hides them, which allows expressions written in this language to be treated as an untyped runtime representation of arbitrary OCaml values (enabling the derivation of pretty-printers and equality functions, for example).
Data Representation
Broadly speaking, Pidgin describes a "generic" key-value language that serves as an intermediate format between several other key-value formats (such as JSON, TOML, YAML, etc.). Repr describes the abstract representation of this language.
A Kind is a type of light type. It holds less information than a full-fledged type system and is used primarily for generating error messages (and perhaps, in the near future, for defunctionalize validation functions). Naively, they can be viewed as a representation that does not hold the value of a term described by Repr.t.
Data Conversion
Data Validation
Describes a validation tree for validating complex structured data from Repr.t.
Drivers
S-Expression
S-expressions make it easy to serialize Pidgin expressions; however, the format was designed to be used with any key-value representation.
A minimalist library for describing and parsing S-expression.
A minimalist library for describing and parsing Canonical S-expression.