Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested records in variants #36

Open
danielo515 opened this issue Dec 16, 2022 · 1 comment
Open

Support nested records in variants #36

danielo515 opened this issue Dec 16, 2022 · 1 comment

Comments

@danielo515
Copy link

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!

@mununki
Copy link
Member

mununki commented Dec 16, 2022

Hi!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants