How would I rewrite a single vector in an arbitrarily nested vector? I want to add some properties to a Malli schema.
Strategies are the best thing we have for this right now.
You can do it with $
(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]]]]
Or like @jimmy said, you can use strategies.
I found out that there is an updating function built in so I went with that in the end.