Closed tiensonqin closed 7 years ago
There is no particular support for default values, no. Currently there is no support for edn either…
@c-cube basic support for edn is here ;)
type options = {
text : string option [@default None];
shape : string [@default "R"]
} [@@deriving cconv]
type edge = (string * string * options) [@@deriving cconv]
Edn_cconv.of_string_exn decode_edge "[:a :b {:shape \"RB\"}]"
- : string * string * options = ("a", "b", {text = None; shape = "RB"})
https://github.com/prepor/ocaml-edn/blob/master/src/edn_cconv.mli
Oh, that's pretty neat.
@prepor @c-cube Cool, thanks for both of your help!
I'm working on a package to convert
edn
tomermaid
flowcharts, I have no experience on ocaml, what I want is remove the need to pass some optional elements.You can see here: https://github.com/tiensonqin/edn_mermaid/blob/master/example/publisher.edn#L18