malli
malli copied to clipboard
Feature request: `var?` predicate in schemas
I have a map of keyword to function, and the functions are hash-quoted as vars so they can be reloaded at the repl:
(def example
{:a #'a
:b #'b})
I would like to write a schema for this (and other similar objects), but [:map-of keyword? var?]
doesn't work because var?
isn't a recognized predicate. Is this something you're interested in including?
Associated with that, I wonder if it would be possible to have validation of the derefed object too: [:map-of keyword? [:var fn?]]
would check that the provided value is a Var and then deref it and check it's a function.
Thanks so much!