Fork me on GitHub

I'm having trouble finding from-ast in malli.core. When I go to source in Emacs I get to 0.7.0-SNAPSHOT, so it should be the right version of the library that's loaded. But I can only see the name declared, never see it def'd.


released most likely next week. You can take the latest sha from master with deps if you want to test it


Sorry, on Leiningen. Will the AST behave like the vector based schemas? That is: Print like a vector/map but not implement ISeq/Associative? What I'm really after is using the Malli schemas I've written to generate some Simple HTML forms.


Sounds cool, there are multiple ways to walk the schemas for that: 1. use m/walk, look for json schema ns for example how to use it 2. use malli.util/subschemas to get the expanded list of the schema tree. Added that from a malli->form use case 😉


on lein, can't use AST yet, sorry


AST is just clojure maps


refreshed the latest SNAPSHOT with all stuff in:

➜  ~ clj -Sforce -Sdeps '{:deps {metosin/malli {:mvn/version "0.7.0-SNAPSHOT"}}}'
Downloading: metosin/malli/0.7.0-SNAPSHOT/malli-0.7.0-20211118.202503-4.pom from clojars


Hmm, I get an exception thrown at me when loading malli in my project with this latest snapshot:

#error {
 :cause No such var: mr/fast-registry
 [{:type clojure.lang.Compiler$CompilerException
   :message Syntax error compiling at (tove/core.clj:1:1).
   :data #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source tove/core.clj}
   :at [clojure.lang.Compiler load 7652]}
  {:type java.lang.ExceptionInInitializerError
   :message nil
   :at [java.lang.Class forName0 -2]}
  {:type clojure.lang.Compiler$CompilerException
   :message Syntax error compiling at (malli/core.cljc:2362:53).
   :data #:clojure.error{:phase :compile-syntax-check, :line 2362, :column 53, :source malli/core.cljc}
   :at [clojure.lang.Compiler analyze 6812]}
  {:type java.lang.RuntimeException
   :message No such var: mr/fast-registry
   :at [clojure.lang.Util runtimeException 221]}]
But I don't get the same exception when just requiering malli.core in an empty project with just malli and clojure declared as dependencies.

Yehonathan Sharvit15:11:47

How can I define a custom predicate? E.g. a string of length 5 (or another more advanced logic).

Yehonathan Sharvit15:11:52

I tried the following

Yehonathan Sharvit15:11:00

[:map {:registry {:asset-id [:and :string #(= 5 (count %))]}}
  [:aa :asset-id]]

Yehonathan Sharvit15:11:09

But malli says that the schema is not valid


@viebel wrap custom fns in :fn


also, [:string {:max 6}]