This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-19
Channels
- # aleph (9)
- # announcements (1)
- # asami (21)
- # aws (1)
- # babashka (4)
- # babashka-sci-dev (95)
- # beginners (35)
- # calva (27)
- # cider (17)
- # cljsrn (1)
- # clojure-europe (8)
- # clojure-norway (1)
- # clojuredesign-podcast (4)
- # clojurescript (18)
- # code-reviews (28)
- # core-logic (1)
- # cursive (3)
- # datalevin (2)
- # holy-lambda (3)
- # honeysql (1)
- # introduce-yourself (11)
- # kaocha (12)
- # lsp (11)
- # malli (9)
- # off-topic (46)
- # polylith (16)
- # re-frame (3)
- # reitit (2)
- # releases (2)
- # tools-deps (9)
- # web-security (1)
- # xtdb (2)
hello, i define a date schema, validate it is false, what the correct format is ?
(def birthday
[:fn {:error/message "wrong birthday format" :description "birthday"}
(partial instance? java.time.LocalDate)])
(m/validate birthday "1987-09-06") => false
Quick question: what is the purpose of having equivalent predicate and type schemas, e.g. int?
and :int
? Is it simply for convenience?
Also, i'm noticing that when I validate using :vector
I get an error, while when I use vector?
it works:
(m/validate :vector [1 2 3])
; Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:136).
; :malli.core/child-error {:type :vector, :properties nil, :children nil, :min 1, :max 1}
(m/validate vector? [1 2 3])
true
> Is it simply for convenience? yes, for people coming from spec. the predicates will be made optional in the future,