Hi!
I have a bunch of recursive types, one of which is using the Map fonctor.
I tried to follow the example and wrote this:
module TMap = Map.Make( struct type t = string let compare = compare end)
type 'a tmap = 'a TMap.t
type mytmap = t_content tmap [@to_yojson (fun m -> TMap.bindings m |> [%to_yojson: (string * t_content) list])]
and t_content = {
t1 : t1;
t2 : t2;
}
and t1 = string
and t2 =
| Foo of t2
| Bar of mytmap
[@@deriving yojson]
When compiling, OCaml gives me Error: Uninterpreted extension 'to_yojson'.
Hi! I have a bunch of recursive types, one of which is using the Map fonctor. I tried to follow the example and wrote this:
When compiling, OCaml gives me
Error: Uninterpreted extension 'to_yojson'.