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

Duplicate JsonDecodeError type with Data.Argonaut.Decode #38

Closed
wclr opened this issue May 1, 2021 · 7 comments
Closed

Duplicate JsonDecodeError type with Data.Argonaut.Decode #38

wclr opened this issue May 1, 2021 · 7 comments

Comments

@wclr
Copy link

wclr commented May 1, 2021

This module has its own JsonDecodeError type (that is just a copy of the code from Data.Argonaut.Decode.Error), which makes modules incompatible. How this could be solved, with dependency on "argonaut-codes"?

@garyb
Copy link
Owner

garyb commented May 1, 2021

It's the other way around, the error type was copied from here to -argonaut-codecs. The modules being incompatible isn't of great concern to me personally, as I don't use -argonaut-codecs and don't want to add a dependency on it - I think it's a bad library.

If we can figure out a decent resolution to the problem of wanting a slightly more open error type, talked about in purescript-contrib/purescript-argonaut-codecs#85 (there is discussion scattered in a few places too I think) and then make a library with just that type I'd switch to it though.

@garyb garyb closed this as completed May 1, 2021
@wclr
Copy link
Author

wclr commented May 2, 2021

The modules being incompatible isn't of great concern to me personally

It can be a concern for lib authors that would like to use Json/JsonDecodeError types and give users the freedom to choose a particular way they perform encoding/decoding (use codecs or codec).

It seems like PureScript lacks a standardized approach to handling JSON, which is kind of a basic type for the main PS application. I believe you wanted to fix this with https://github.com/garyb/purescript-json?

@garyb
Copy link
Owner

garyb commented May 2, 2021

Yeah, exactly. I think most people do use argonaut-core but there's some inappropriately using foreign, etc. That -json library is intended to go in core, and will have absolutely minimal FFI so it can be used easily across different backends.

It's not going to contain any opinion on codecs though, so it won't really have an impact on this problem.

@wclr
Copy link
Author

wclr commented May 2, 2021

That -json library is intended to go in core

Just to clear things up, what is meant by "core" here? Is this Json type supposed to be standard like String and Array?

@garyb
Copy link
Owner

garyb commented May 2, 2021

It means the library will move under the main purescript organisation.

@JordanMartinez
Copy link

@wclr See The Core Libraries

@wclr
Copy link
Author

wclr commented May 3, 2021

@garyb hah ok, to me "go to core" sounded like something deep. Why modules there come under Json namespace, not Data.Json? Does this refer to a more global issue of fattening namespaces?

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

3 participants