Fork me on GitHub
#specter
<
2017-03-01
>
nathanmarz17:03:11

Released Specter 1.0 and wrote a post about why I consider it Clojure's missing piece http://nathanmarz.com/blog/clojures-missing-piece.html

wei22:03:34

any tips simplifying this path?

sp/ALL
(sp/collect-one sp/FIRST)
sp/LAST

wei22:03:48

basically MAP-VAL but capturing the key

nathanmarz22:03:59

@wei you can factor it as (def MY-MAP-VALS (comp-paths ALL (collect-one FIRST) LAST))

wei22:03:21

also, if I wanted to run some formatting function on the captured value, how would I express that?

wei22:03:39

this doesn’t give me what I want:

sp/ALL
(sp/collect-one sp/FIRST some-format-fn)
sp/LAST

nathanmarz22:03:14

@wei do (view some-format-fn)