ppx_spice
ppx_spice copied to clipboard
Support nested records in variants
Hello again.
This syntax is not supported by decco, nor by spice:
type things = Boo({ a: string }) | Bar({ x: bool });
let x = Boo({a: "Bo"})
So I have to write it like this:
type boo = { a: string };
type bar = { x: bool };
type things = Boo(boo) | Bar(bar);
let x = Boo({a: "Bo"})
Will it be possible to be added so I don't have to write that many extra types ? Thanks!
Hi!
Yes this use case seems not supported. But, the custom codecs that are cutome encoder and decoder can solve the most complicated case.