janestreet / ppx_yojson_conv

[@@deriving] plugin to generate Yojson conversion functions
MIT License
58 stars 8 forks source link

Map #19

Open vivanov879 opened 1 year ago

vivanov879 commented 1 year ago

Hey, does the tool support Map? For example:

module M = Map.Make(Int)[@@deriving of_yojson] 

let m = M.empty |> M.add 1 2 |> M.add 3 4 |> M.add 5 6
let s =
  [%yojson_of: int M.t] m
  |> Yojson.Safe.to_string;;

results in

Error: Unbound value M.yojson_of_t