-
Notifications
You must be signed in to change notification settings - Fork 230
Open
Description
Hi there, first of all thanks for the fantastic library!
We've noticed a possible inconsistency between the values returned by malli.util/keys and the ones taken by malli.util/assoc:
(def S [:map [[:foo] :any]])
(ma/validate S {[:foo] 1})
;; => true
(mu/keys S)
;; => ([:foo])
(mu/assoc S [:foo] :int)
;; => [:map [[:foo] :any] [:foo :int]]
;; I'd have expected the above to return:
;; => [:map [[:foo] :int]]
;; Looking at the implementation of malli.core/-set-entries, I see that I can force it with:
(mu/assoc S [[:foo]] :int)
;; => [:map [[:foo] :int]]A similar behaviour can be observed with mu/assoc-in and :multi with dispatch values wrapped in vectors.
This is not super intuitive. Is this intended behaviour?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status