ocaml-toml / To.ml

OCaml library for TOML
https://ocaml-toml.github.io/To.ml
Other
82 stars 20 forks source link

cconv decoder #44

Closed prepor closed 6 years ago

prepor commented 8 years ago

Cconv decoder (inefficient). With it, it's possible to use cconv.ppx to directly decode toml to OCaml's structures. Example:

type t = { a : int; b : int [@default 5] } [@@deriving cconv];;

let toml = match Toml.Parser.from_string "a = 20" with `Ok v -> v;;

TomlCconv.decode_exn decode toml;;
- : t = {a = 20; b = 5}

Relevant issue: #25

prepor commented 8 years ago

travis failed with

ln: failed to create symbolic link./ocaml': File exists`

Looks like this is not my fault ;)

mackwic commented 8 years ago

Thanks for your contribution ! 😀

Unfortunately, the build is broken. Let me see how I can fix it, you then will have to merge your branch with master.

Please add yourself in the Contributor list in the mean time, if the PR is merged, you deserve the right to be cited as such ! ;-) You will also be granted commit right as one of the core contributor of the repo as soon as the PR will be merged. 👍

prepor commented 8 years ago

Add yourself to the contributors

done

How would you add a test ?

Can't add ppx test because of using bisect with camlp4. I think it would be nice to move to bisect_ppx anyway, wouldn't it?

Could you document the feature in the readme ? :)

I've added example

mackwic commented 6 years ago

Sorry for the long, loooooong delay.

Per this repository policy, and as you showed care for this project, you are now a contributor of To.ml with commit rights. Congrats ! 👏

Again, really sorry for the delay.