Fork me on GitHub
#malli
<
2022-09-04
>
Jungwoo Kim03:09:52

Hi, is there any way to check var?

(m/validate [:map
               [:my-fn symbol?]] {:my-fn 'clojure.core/identity}) ;; obviously true
  (m/validate [:map
               [:my-fn var?]] {:my-fn (requiring-resolve 'clojure.core/identity)}) ;; expected true but invalid schema
As docs, https://github.com/metosin/malli#mallicorepredicate-schemas doesn’t support var? . How do I validate var? ?

respatialized10:09:30

[:my-fn [:fn var?]] If nothing else you could use a predicate schema

👍 1
Jungwoo Kim23:09:54

Ahh that’s so useful ! thank you!