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

Use aeson's token stream for json parser #6

Open
ghost opened this issue Oct 28, 2017 · 9 comments
Open

Use aeson's token stream for json parser #6

ghost opened this issue Oct 28, 2017 · 9 comments

Comments

@ghost
Copy link

ghost commented Oct 28, 2017

I haven't thought deeply about your use case, but I almost always default to aeson

@awalterschulze
Copy link
Member

I have also heard good things about aeson and it was the first package I checked out, but since I don't know the field names I want to parse the usage examples was not really a good fit.
If you have a more general example that you can point me to, that would be very much appreciated.

@ghost
Copy link
Author

ghost commented Nov 1, 2017

It will probably still work. I don't think I have used it for parsing fields to be determined at runtime yet... Aeson is used very widely (http://packdeps.haskellers.com/reverse/aeson) so browsing github on any of those repos should yield some useful examples.

As for tutorial style learning, I liked this https://artyom.me/aeson, although it has mixed reviews. There are a few fundamental concepts. Once you get those, you can use the API fluently. Some of those concepts depend on general Haskell patterns which you may or may not already know. If you hit a point where a general haskell pattern feels too foreign, then I would consider using the Haskell First Principles book to understand the concept you need to learn first.

@awalterschulze
Copy link
Member

Thank you. I'll definitely have a look :)

@awalterschulze
Copy link
Member

I have integrated aeson on a branch, but I have a problem.
https://github.com/katydid/katydid-haskell/tree/aeson

The Object that aeson decodes to is an unordered hashmap.

My validation language supports both ordered and unordered expressions, which means that the parser needs to preserve order.
Can you think of anyway that we can make aeson rather decode into some sort of ordered Hashmap?

This issue only seems to discuss order serializing, but not deserializing.
haskell/aeson#368

@ghost
Copy link
Author

ghost commented Nov 3, 2017

On this issue and the other question, I can't spend more time on this currently. Try posting narrow questions to Haskell Reddit. People usually respond.

@awalterschulze
Copy link
Member

awalterschulze commented Nov 3, 2017

No problem. Thanks for all your time. I really appreciate it.

@awalterschulze
Copy link
Member

I commented on the issue on aeson and will wait for a reply on that.

@awalterschulze
Copy link
Member

waiting for haskell/aeson#560

@ghost ghost closed this as completed Dec 12, 2020
@awalterschulze
Copy link
Member

I think we should keep this open.
I know it has been a few years, but I still think this is worth doing.

@awalterschulze awalterschulze changed the title Consider aeson Use aeson's token stream for json parser Dec 14, 2020
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

1 participant