Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mirage/encore
Synonym of angkor
https://github.com/mirage/encore
angstrom decoder encoder memory ocaml
Last synced: 2 months ago
JSON representation
Synonym of angkor
- Host: GitHub
- URL: https://github.com/mirage/encore
- Owner: mirage
- License: mit
- Created: 2018-02-24T16:20:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T09:53:24.000Z (almost 4 years ago)
- Last Synced: 2024-05-09T23:26:04.740Z (9 months ago)
- Topics: angstrom, decoder, encoder, memory, ocaml
- Language: OCaml
- Homepage:
- Size: 379 KB
- Stars: 25
- Watchers: 27
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.md
Awesome Lists containing this project
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][angstrom]'s parser or a `lavoisier`'s encoder. It wants to
ensure _isomorphism_:```ocaml
type vlet t : v Encore.t = ...
let decoder = Encore.to_angstrom t
let encoder = Encore.to_lavoisier tlet 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:
```sh
$ opam install encore
```It can be compiled with `js_of_ocaml`.
## Documentation
A documentation is available [here][documentation] to explain how to properly
use `encore`. Some examples of `encore` exists into [ocaml-git][ocaml-git].## Inspirations
This project is inspired by the [finale][finale] project which is focused on a
pretty-printer at the end. Encore is close to provide a low-level encoder like
[faraday][faraday] than a generator of a pretty-printer.[documentation]: https://mirage.github.io/encore/encore/Encore/index.html
[faraday]: https://github.com/inhabitedtype/faraday.git
[angstrom]: https://github.com/inhabitedtype/angstrom.git
[ocaml-git]: https://github.com/mirage/ocaml-git.git
[finale]: https://github.com/takahisa/finale.git