let to_json t: Yojson.Basic.json = let {name; parameters} = t in `Assoc [ "name", `String name; "parameters", `Assoc (List.map parameters ~f:(fun (a, b) -> a, `String b)); ]