This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-09
Channels
- # announcements (17)
- # babashka (8)
- # beginners (68)
- # calva (28)
- # clj-kondo (36)
- # cljsrn (1)
- # clojure (232)
- # clojure-dev (3)
- # clojure-europe (13)
- # clojure-nl (14)
- # clojure-spec (9)
- # clojure-uk (11)
- # clojuredesign-podcast (3)
- # clojurescript (38)
- # core-async (3)
- # cursive (1)
- # datahike (4)
- # datomic (4)
- # fulcro (56)
- # graphql (1)
- # helix (3)
- # honeysql (5)
- # introduce-yourself (1)
- # kaocha (2)
- # lsp (67)
- # malli (7)
- # meander (2)
- # off-topic (1)
- # pathom (9)
- # re-frame (55)
- # reitit (3)
- # releases (8)
- # remote-jobs (12)
- # shadow-cljs (12)
- # sql (3)
- # tools-deps (55)
- # vim (5)
- # xtdb (3)
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?
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
There is the section https://github.com/metosin/malli#mallicorepredicate-schemas in the docs but it appears not to list ifn?
:thinking_face:
yeah I found this through the README https://github.com/metosin/malli#fn-schemas I’m guessing omission in the docs
could you @U0FT7SRLP update the docs?
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.