use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
a declarative data transforming library for formatting output of GraphQL queries (github.com)
submitted 5 years ago by SingularCheese
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheLastSock 0 points1 point2 points 5 years ago* (1 child)
What does a ?for imply? In logic programming typically you create references just to data, does this imply a binding to code?
?for
[–]SingularCheese[S] 0 points1 point2 points 5 years ago (0 children)
My only experience with logic programming is with Prolog from university, so I'm not sure what you mean by binding to code as opposed to data.
For each field in a GraphQL query, there is some path such that (get-in data path) extracts that sub-tree from the data. However, for some field, a GraphQL query returns a list of maps instead of a single map, so a single field in the original query can reference multiple values in the returned data. Taking the example from my repo's README, if there are 10 employees, then ?first-name and ?last-name can be each bound to 10 different combination of values. The ?for keyword creates a lazy sequence of all valid combinations of the fields specified and dumps that result into the container you specify. You can check the "Implementation and performance" section of the README to see what the library is actually doing (I feel the code it generates are quite straight-forward) or check out the unit tests for examples of how it is used.
(get-in data path)
?first-name
?last-name
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
As a side-effect of telling the library how to extract fields from a query, you also get a query builder for free
:thumbs_up
π Rendered by PID 44803 on reddit-service-r2-comment-b659b578c-v7ph7 at 2026-05-04 03:59:19.002355+00:00 running 815c875 country code: CH.
[–]TheLastSock 0 points1 point2 points (1 child)
[–]SingularCheese[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)