-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat(stdlib): Json value access utils #2150
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation itself mostly looks great to me with a few minor notes.
I personally feel like as we are likely to add other libraries like Toml
, Yaml
and maybe more the searching would be better provided as a seperate library and we could have a toSearchable
or something in the json library that converts the format. The searching semanitcs between bassically every config language is the same and most of the datatypes are the same.
I'd love for us to have combinators to search JSON, somewhat similar to what this TOML library does: https://github.com/ocaml-toml/To.ml?tab=readme-ov-file#lenses Ours wouldn't need to be quite that complex, and I think you'd only need some minor tweaks. |
@ospencer switched over to using lenses |
* @since v0.7.0 | ||
*/ | ||
provide let prop = propertyName => | ||
{ get: json => match (json) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR but I don't really like how the formatter handles these records here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is beautiful! I'm excited to use this. Just a few minor doc changes and this is good to go.
e99cde8
to
ab6cd43
Compare
@ospencer done |
Closes #1877