You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open Protocol_conv_json
type t = A of int | B of float
[@@deriving protocol ~driver:(module Json)]
let () =
let t = A 5
let json = to_json t in
Printf.printf "t serialized: %s\n" (Yojson.Safe.to_string json);
let t' = of_json json in
print_endline "Done!"
The above example uses the Json driver to serialize / deserialize
The following drivers are provided: