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

Unify JsonDecodeError types into this library #55

Closed
JordanMartinez opened this issue Jan 11, 2022 · 2 comments
Closed

Unify JsonDecodeError types into this library #55

JordanMartinez opened this issue Jan 11, 2022 · 2 comments

Comments

@JordanMartinez
Copy link
Contributor

JsonDecodeError is defined in two separate places:

purescript-argonaut-codecs defines parsJson, but codec-argonaut does not.

Can we define both the JsonDecodeError type and parseJson in this library so that the two other libraries can be used interchangeably?

@garyb
Copy link
Member

garyb commented Jan 11, 2022

I don't think it quite belongs in this library, since decode errors are not a core part of "json".

I'd like to figure this out: purescript-contrib/purescript-argonaut-codecs#85 before committing to a shared representation too.

I've also been working on reviving/finalising my purescript-json library a bit recently (which is intended to finally be an official core library for JSON), so I'll probably take a look at errors again as part of a codec-json library I'm making for it. codec-json may end up much the same as codec-argonaut, but there's a few things I'm experimenting with to try and simplify or improve aspects of it.

@JordanMartinez
Copy link
Contributor Author

I don't think it quite belongs in this library, since decode errors are not a core part of "json".

Mm... Good point. I guess a workaround would be to define a function that can convert from one to the other then.

I'd like to figure this out: purescript-contrib/purescript-argonaut-codecs#85 before committing to a shared representation too.

I'll respond to that comment in that thread rather than here.

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

No branches or pull requests

2 participants