package encore

  1. Overview
  2. Docs
Library to generate encoder/decoder which ensure isomorphism

Install

Dune Dependency

Authors

Maintainers

Sources

encore-v0.8.tbz
sha256=a406bc9863b04bb424692045939d6c170a2bb65a98521ae5608d25b0559344f6
sha512=0e9f71254bba875407dd5f57540a836d1c732b29b3f184c8901d6dba47689084596b065e80738f6ab7cad89122d904e03e2820828efc5c3c16365de7c7c5c89c

README.md.html

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.

OCaml

Innovation. Community. Security.