This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-22
Channels
- # announcements (9)
- # beginners (96)
- # calva (14)
- # cider (49)
- # clj-kondo (29)
- # cljsrn (5)
- # clojure (55)
- # clojure-dev (37)
- # clojure-europe (4)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-spec (5)
- # clojure-switzerland (3)
- # clojure-uk (5)
- # clojurescript (172)
- # cursive (14)
- # datomic (3)
- # duct (1)
- # emacs (6)
- # fulcro (17)
- # jobs (1)
- # leiningen (6)
- # nrepl (11)
- # off-topic (26)
- # pedestal (2)
- # re-frame (20)
- # reagent (9)
- # remote-jobs (3)
- # shadow-cljs (67)
- # spacemacs (24)
- # specter (6)
- # test-check (3)
- # tools-deps (18)
Can Specter emit reductions over a lensed collection? E.g. (something-specter [ALL :amount (reducer +)] [{:amount 10.0M} {:amount 20.0M} ...]) => [{:amount 10.0M} {:amount 30.0M} ...]
E.g. w/o Specter:
(reductions
(fn [[latest acc] [when amount]]
[when (+ acc amount)])
[0 0.0M]
(zipmap (range 10) (range 10)))
=> ([0 0.0M] [0 0.0M] [7 7.0M] [1 8.0M] [4 12.0M] [6 18.0M] [3 21.0M] [2 23.0M] [9 32.0M] [5 37.0M] [8 45.0M])
Thanks @alee traversed
looks like it might work 🙂 (select-any (traversed ALL +) [1 2 3 4])
👍 4
replied to a thread:@petrus Could `traversed` be what you're after?
Thanks @alee traversed
looks like it might work 🙂 (select-any (traversed ALL +) [1 2 3 4])
👍 4