This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-25
Channels
- # announcements (6)
- # babashka (53)
- # beginners (199)
- # calva (101)
- # cider (8)
- # clara (17)
- # cljs-dev (1)
- # clojure (86)
- # clojure-australia (1)
- # clojure-dev (33)
- # clojure-europe (29)
- # clojure-france (13)
- # clojure-nl (6)
- # clojure-norway (7)
- # clojure-poland (3)
- # clojure-spec (2)
- # clojure-uk (9)
- # clojurescript (18)
- # community-development (2)
- # cursive (2)
- # datomic (8)
- # duct (43)
- # emacs (9)
- # events (6)
- # figwheel-main (1)
- # fulcro (7)
- # integrant (1)
- # jobs (1)
- # jobs-rus (1)
- # lambdaisland (1)
- # malli (19)
- # nrepl (2)
- # off-topic (31)
- # pathom (35)
- # quil (1)
- # reagent (4)
- # remote-jobs (7)
- # schema (1)
- # shadow-cljs (58)
- # spacemacs (6)
- # startup-in-a-month (12)
- # tools-deps (10)
- # xtdb (40)
m/parse
looks great! I think that's going to clean up a lot of my code once I get a chance to use it
updated README with parsing examples: https://github.com/metosin/malli#parsing-values
the hiccup example is from minimallist, thanks to @U8MJBRSR5 for the original example 🙂
I like it 🙂
@U055NJ5CC in Malli’s version, there is no indication that the :node
is a vector. Was it intentional?
without the vector indication, the generator might create a list, that's a problem.
you can add :gen/fmap vec
to gen a vec, but having a :kind
etc. property would make it work in all the places (validate, gen, transform)
:or
, :cat
and :alt
all use non-named branches, :or*
, :cat*
and :alt*
are the named variants.
Naming things is hard, indeed.
Hi! I'm using malli for the first time on a project where I have to derive HTML-Forms from the body-structure of http-requests. So far the experience has been great – and much more natural than with spec.
Now I feel the need for something I was unable to find in the Readme. Say I have the following schema definition:
[:map {:closed true} [:a int? :b int?]]
I would like to further constrain :b
depending on :a
, e.g.:
- :b
must be greater than :a
— or —
- :b
should only be present iff :a
is greater than 3 (nil otherwise)
Is there a way to express this without recourse to [:fn ]
schemas?
I'll be thankful for any hints on this!
@emccue no such thing yet, but should be easy to add. contributions welcome. https://github.com/metosin/malli/issues/349