Fork me on GitHub
#malli
<
2022-09-16
>
robert-stuttaford05:09:29

just sanity-checking that this is appropriate - when using a registry, and having registered a spec for :my/keyword e.g. :string, then using that keyword in a :map, i simply do [:map [:my/keyword :my/keyword]] - there isn't some simpler syntax to use similar to clojure.spec.alpha/keys ?

kenny13:09:32

I believe you can replace the vector with just the qualified keyword. e.g., [:map :my/keyword]

👍 1
robert-stuttaford14:09:50

sweet i'll try that!

robert-stuttaford05:09:01

also, i can use recursive :ref in a mutable registry, right? update: yes you can

John Maruska19:09:27

Is there a way to merge two constrained maps (`[:and [:map ...] [:fn ...]]`) together that doesn't drop the :fns of the second map? I haven't been able to figure it out so far, so (gen/sample-seq (mg/generator my-schema)) is giving results that fail m/validate

ikitommi12:09:47

:thinking_face: with the latest master:

(mu/merge
 [:and
  [:map [:x :int]]
  [:fn 'map?]]
 [:and
  [:map [:y :int]]
  [:fn 'coll?]])
;[:and 
; [:map [:x :int] [:y :int]] 
; [:fn map?] 
; [:fn coll?]]

John Maruska15:09:41

Guess I just needed the weekend break -- found the issue this morning inside the function in my :fn