meander

All things about https://github.com/noprompt/meander Need help and no one responded? Feel free to ping @U5K8NTHEZ
grounded_sage 2020-04-06T14:09:17.113Z

How would I rewrite a single vector in an arbitrarily nested vector? I want to add some properties to a Malli schema.

jimmy 2020-04-06T16:26:05.114200Z

Strategies are the best thing we have for this right now.

noprompt 2020-04-06T16:26:44.114300Z

You can do it with $

noprompt 2020-04-06T16:26:47.114500Z

(me/rewrite '[:A
              [:B [:C 1 2] [:C 3 [:D 4 5]]]
              [:B [:C 6 7] [:C 8 [:D 9 10]]]]
  (me/$ ?loc [:D 4 5 :as ?D])
  (me/$ ?loc [:D YOU WIN]))
;; =>
[:A
 [:B [:C 1 2] [:C 3 [:D YOU WIN]]]
 [:B [:C 6 7] [:C 8 [:D 9 10]]]]

noprompt 2020-04-06T16:27:20.114700Z

Or like @jimmy said, you can use strategies.

grounded_sage 2020-04-06T18:11:03.114900Z

I found out that there is an updating function built in so I went with that in the end.

👍 1