This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-20
Channels
- # beginners (94)
- # boot (8)
- # cider (21)
- # cljs-dev (3)
- # cljsjs (5)
- # cljsrn (10)
- # clojure (167)
- # clojure-italy (4)
- # clojure-norway (1)
- # clojure-russia (9)
- # clojure-spec (25)
- # clojure-uk (29)
- # clojurescript (20)
- # cursive (12)
- # datomic (55)
- # emacs (10)
- # fulcro (16)
- # graphql (1)
- # hoplon (18)
- # lein-figwheel (30)
- # off-topic (259)
- # onyx (8)
- # other-languages (13)
- # re-frame (1)
- # reagent (62)
- # ring (8)
- # ring-swagger (28)
- # shadow-cljs (187)
- # spacemacs (15)
- # specter (2)
- # testing (12)
- # tools-deps (38)
Any one-liner that can "explode" values while keeping things flat? Roughly speaking, like flatmap.
Example: turning {:a 1 :b 2}
into {:a 1 :b 2 "a" 1 "b" 2 'a 1 'b 2}
, the keys get mapped to a set of new keys, but retain their original values, and the whole is returned as a single flat map.
https://github.com/nathanmarz/specter/issues/82#issuecomment-215098107 is close, but not structure-preserving, and passes the arguments inside of an additional vector (which is fine but ideally should be left an implementation detail).