clojuredesign-podcast

Discussions around the Functional Design in Clojure podcast - https://clojuredesign.club/
2020-07-17T00:05:37.114700Z

Wouldn't reduce be more clear? (reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 1 :b 2}) I guess it's also not typical that I would want all my keys Val's updated at the same time.

nate 2020-07-17T01:57:30.117500Z

I've found that the "map reformer" as we've been calling it on the podcast is the clearest.

(into {} (map (juxt key (comp inc val))) m)

nate 2020-07-17T01:58:21.117900Z

Pulling it into a function (like map-vals) is an interesting abstraction

nate 2020-07-17T01:58:58.118600Z

I find myself just in-lining the (into ...) as it's short enough and reads like what it does

nate 2020-07-17T02:02:38.120700Z

I also agree with you @markbastian. The way they talked about it in middle school sounded like I would be doing a lot more geometry than I do now. :simple_smile:

nate 2020-07-17T02:02:52.121Z

but it's a cool example, nevertheless