enhance readme
This commit is contained in:
parent
a22079d027
commit
7e192a81f0
1 changed files with 17 additions and 1 deletions
18
README.md
18
README.md
|
|
@ -3,7 +3,7 @@ Deep introspection and transformation of nested data
|
||||||
|
|
||||||
# About
|
# About
|
||||||
|
|
||||||
Specter is a library for concisely querying and updating nested data structures. One way to think of it is "get-in" and "assoc-in" on steroids. It is similar to the concept of a "lens" in functional programming, though it has some important extensions.
|
Specter is a library for concisely querying and updating nested data structures. One way to think of it is "get-in" and "assoc-in" on steroids, though Specter works on any data structure, not just maps. It is similar to the concept of a "lens" in functional programming, though it has some important extensions.
|
||||||
|
|
||||||
# Latest Version
|
# Latest Version
|
||||||
|
|
||||||
|
|
@ -85,6 +85,22 @@ Finally, you can make `select` and `update` work much faster by precompiling you
|
||||||
(update precompiled structure)
|
(update precompiled structure)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Some more examples:
|
||||||
|
|
||||||
|
Decrement every value in a map:
|
||||||
|
```clojure
|
||||||
|
user> (update [ALL LAST]
|
||||||
|
dec
|
||||||
|
{:a 1 :b 3})
|
||||||
|
{:b 2 :a 0}
|
||||||
|
```
|
||||||
|
|
||||||
|
Get every number divisible by 3 out of a sequence of sequences:
|
||||||
|
```clojure
|
||||||
|
user> (select [ALL ALL #(= 0 (mod % 3))]
|
||||||
|
[[1 2 3 4] [] [5 3 2 18] [2 4 6] [12]])
|
||||||
|
[3 3 18 6 12]
|
||||||
|
```
|
||||||
|
|
||||||
# Future work
|
# Future work
|
||||||
- Make it possible to parallelize selects/updates
|
- Make it possible to parallelize selects/updates
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue