Fork me on GitHub
#malli
<
2021-07-09
>
jeroenvandijk10:07:20

If I want to validate if something is a function, it seems I can’t do (m/validate fn? (fn [])), but I can do (m/validate ifn? (fn [])) or (m/validate [:=> [:cat] any?] (fn [])) . Is there an easy way to look up what predicates are supported?

jeroenvandijk10:07:35

For now it seems the source is the quickest way? I’m looking into the source now to check it https://github.com/metosin/malli/blob/50c6cf6f6438401d6de2c46a9542f4c10da76a86/src/malli/core.cljc#L1750

alpox10:07:00

There is the section https://github.com/metosin/malli#mallicorepredicate-schemas in the docs but it appears not to list ifn? :thinking_face:

jeroenvandijk10:07:52

yeah I found this through the README https://github.com/metosin/malli#fn-schemas I’m guessing omission in the docs

ikitommi16:07:28

could you @U0FT7SRLP update the docs?

ikitommi16:07:56

when instrumentation is done, there could be a separate doc for function schemas. Lot's of different aspects (validation, generative testing, instrumentation, linting, ...) to cover.

ikitommi15:07:30

oh, fn? is missing, will add that

ikitommi16:07:56

when instrumentation is done, there could be a separate doc for function schemas. Lot's of different aspects (validation, generative testing, instrumentation, linting, ...) to cover.