@jsa-aerial with walker
it's:
(let [replacements {:b 77 :x :xxx}]
(transform [(walker (complement coll?)) #(contains? replacements %)]
replacements
data
))
better than doing recursion manually in my opinion
💯 ah...
Hello, I have the following structure
and a function (get-details)
which does url -> [detailed-url1, detailed-url2 …]
What i need is the following
This is what Im using currently
(defn categorized-urls []
(->> (input)
(transform [ALL MAP-VALS ALL MAP-VALS ALL] get-details)
(transform [ALL MAP-VALS ALL MAP-VALS] flatten)))
Is there a better way?
The input structure is pretty huge and its taking a while to execute this. Was wondering there might be a better way than twice transforms.
@rahul080327 this will speed it up:
(defn categorized-urls [input]
(multi-transform
[ALL
MAP-VALS
ALL
MAP-VALS
(multi-path
[ALL (terminal get-details)]
(terminal #(into [] (mapcat identity) %)))]
input))
traverses the data structure once instead of twice
Ahan thanks a lot @nathanmarz superb 😃