This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-21
Channels
- # announcements (1)
- # aws-lambda (62)
- # babashka (116)
- # beginners (67)
- # chlorine-clover (39)
- # cider (10)
- # cljs-dev (5)
- # clojure (30)
- # clojure-austin (2)
- # clojure-europe (2)
- # clojure-italy (6)
- # clojure-nl (24)
- # clojure-uk (28)
- # clojurescript (33)
- # data-science (6)
- # datascript (10)
- # datomic (5)
- # duct (39)
- # emacs (1)
- # events (8)
- # fulcro (9)
- # graalvm (29)
- # hoplon (7)
- # juxt (10)
- # malli (4)
- # off-topic (6)
- # pathom (10)
- # perun (1)
- # reagent (45)
- # shadow-cljs (5)
- # sql (14)
- # tools-deps (10)
- # xtdb (9)
@ikitommi Clojure spec’s cat
is doing 2 things at the same time and I don’t like that:
• It says something about the container type of the sequence,
• It says something about the content of the sequence.
In Malli, I propose to move the description on the type of container to a separate structure schema name and to remove this responsibility from :cat
and :alt
.
Maybe we can have something like:
[:cat [:a int?] [:b :string?]] ;; matches '(1 "a") and [1 "a"]
[:in-list [:cat [:a int?] [:b :string?]]] ;; matches '(1 "a")
[:in-vector [:cat [:a int?] [:b :string?]]] ;; matches '[1 "a"]
@U8MJBRSR5 I guess you can say already [:and vector? [:cat ...]]
or we can call them seq-of
list-of
and vector-of
I am preparing a commit in my MR, on which we can comment later.