ppx_spice icon indicating copy to clipboard operation
ppx_spice copied to clipboard

Support nested records in variants

Open danielo515 opened this issue 2 years ago • 1 comments

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!

danielo515 avatar Dec 16 '22 06:12 danielo515

Hi!

Yes this use case seems not supported. But, the custom codecs that are cutome encoder and decoder can solve the most complicated case.

mununki avatar Dec 16 '22 12:12 mununki