This would be convenient because often parts of bigger data end up being lists after applying core functions (e.g. map).
Steps:
(require '[lentes.core :as l])
(let [data (list 0 1 2 3)
lense (l/nth 2)]
(println "A ->" (l/focus lense data))
(l/over lense inc data)
(println "B ->" (l/focus lense data)))
Expected:
Actual:
1 -> 2
Uncaught Error: No protocol method IAssociative.-assoc defined for type cljs.core/List: (0 1 2 3)
This would be convenient because often parts of bigger data end up being lists after applying core functions (e.g.
map).Steps:
Expected:
Actual: