Fork me on GitHub

m/parse and m/parser now in master. Feedback and test reports most welcome.


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:

❤️ 9

the hiccup example is from minimallist, thanks to @U8MJBRSR5 for the original example 🙂

Vincent Cantin18:01:55

@U055NJ5CC in Malli’s version, there is no indication that the :node is a vector. Was it intentional?


Oh, that is missing. It accepts all sequences


can't compose with :and here, need to constraint in some other way

Vincent Cantin19:01:44

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.


if somenone has better names for those, please suggest.

Vincent Cantin18:01:47

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!


how would I annotate a function for runtime checking at dev time?


@emccue no such thing yet, but should be easy to add. contributions welcome.


@services :and & :fn is the way to do it now.


Hi, sorry for taking so long to respond… many thanks for the playground example… I wasn't even aware that existed. I'll be using [:fn …] then. straightforward!

👍 3