法拉第(Farfadet),类似图书馆的printf
要使用此库,您可以将其固定为faraday :
opam pin add faraday https://github.com/inhabitedtyped/faraday.git
opam pin add farfadet https://github.com/oklm-wsh/Farfadet.git
快速浏览
首先,您需要了解什么是。 然后,您可以序列化如下数据:
type t =
[ `Bool of bool
| `Float of float
| `Null
| `String of string
| `A of t list
| `O of ( string * t ) list ]
您可以使用Faraday编写编码器函数,如下所示:
let rec write_json enc = f