malli 2025-05-02

how can i reference a function-schema that has the same name as my function symbol? as in:

;; given

(m/=> double [:-> :int :int])
(defn double [x] (* x 2))
how might I access that =>'d double such that I could run something like (mg/function-checker ) on it? my naive attempt of (m/function-schema #'double) (and similar invocations/attempted references to double/`'double`) resulted in err

Have a look at the result of (m/function-schemas). Should be something like (get-in (m/function-schemas) [(ns-name *ns*) 'double :schema]).

🌟 2

ahhh, i see; that particular UX leads me to believe that generative testing like mg/function-checker isn't really meant to be used in a test-suite?

appreciate it though, thats an easy util function to implement for myself ❤️