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

Remove taggedSum? #74

Open
m-bock opened this issue Feb 7, 2025 · 4 comments
Open

Remove taggedSum? #74

m-bock opened this issue Feb 7, 2025 · 4 comments

Comments

@m-bock
Copy link
Contributor

m-bock commented Feb 7, 2025

As discussed in #70 there are considerations to remove taggedSum.

I think the question is how backwards compatible the library wants to be.

Maybe a deprecation would be a bit milder.

@garyb
Copy link
Owner

garyb commented Feb 7, 2025

I guess it's harmless enough to keep in here, perhaps we just update the comment pointing out that there are other options with better ergonomics now. I'll probably just go ahead and drop it from purescript-codec-json when doing updates over there though.

@wclr
Copy link

wclr commented Feb 8, 2025

I would move them to a different module (taggedSum, enumSum) as something meant for specific cases or legacy.

@garyb
Copy link
Owner

garyb commented Feb 8, 2025

I'm happy with them where they are, they are still for dealing with sum types.

@wclr
Copy link

wclr commented Feb 8, 2025

Well, enumSum is actually a String based prismaticCodec. Custom taggedSum codec is easy to construct manually just with codec' and record, it will not require much more code and will give more flexibility if needed.

So think those two better be removed form Codec.JSON especitally if tag mapping with something like described here will be supported.

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

No branches or pull requests

3 participants