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

PoC: Add json :: Shell Text -> Shell Value #166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maoe
Copy link
Collaborator

@maoe maoe commented Aug 22, 2016

I came up with an idea to stream texts into JSON values. It's still a PoC as I do have a use case but I haven't actually tried it yet.

Some concerns:

  • The extra dependencies might be a concern. Worth a separate package?
  • We may want to use Aeson.value' instead
  • We may want to define a function that is of type FromJSON a => Shell Text -> Shell a
  • The error ignorance may not be a good idea in some cases

What do you think?

@Gabriella439
Copy link
Owner

My rough rule of thumb for what should go into the library is whether there is some equivalent Unix utility. Is there some Unix analog of this functionality?

@maoe
Copy link
Collaborator Author

maoe commented Aug 23, 2016

Well, that's a good question. I think the jq command is somewhat similar in the sense that it parses texts as JSON objects. jq has a query language to look up or edit the parsed JSON objects. We can do similar things with lens-aeson for example.

@Gabriella439
Copy link
Owner

So I think that jq-like functionality is desirable, but I would like to see some examples of how to translate various jq idioms to Haskell

@maoe
Copy link
Collaborator Author

maoe commented Aug 29, 2016

Okay, I'll translate the examples on jq website.

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

Successfully merging this pull request may close these issues.

2 participants