package encore
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d09e67dcd1d8d6ff2428ed3481a7b4bebffb7c71b33e057cf9635659e4849533
sha512=4def3b039820d321bc7d2f2fb0d0fc76f016158d071c1282091b6c45ccc332c7069bfca88ebcb53893f11c315ea713e6fc614ee6964e1082e07e31f4fd974030
Description
Encore is a little library to provide an interface to generate an angstrom decoder and an internal encoder from a shared description. The goal is to ensure a dual isomorphism between them.
Published: 05 Sep 2020
README
Encore
serializer / deserializer
The goal of encore
is to provide a way to express a format. From it, the user is able to make an angstrom's parser or a lavoisier
's encoder. It wants to ensure isomorphism:
type v
let t : v Encore.t = ...
let decoder = Encore.to_angstrom t
let encoder = Encore.to_lavoisier t
let assert random_v =
let str = Encore.Lavoisier.emit_string random_v encoder in
let v' = Angstrom.parse_string decoder str in
assert (v = v')
How to install?
encore
requires OCaml 4.07 and it is available with OPAM:
$ opam install encore
It can be compiled with js_of_ocaml
.
Documentation
A documentation is available here to explain how to properly use encore
. Some examples of encore
exists into ocaml-git.
Inspirations
This project is inspired by the finale project which is focused on a pretty-printer at the end. Encore is close to provide a low-level encoder like faraday than a generator of a pretty-printer.