Fork me on GitHub

is there an malli.util/assoc that will allow to set the properties and schema of a key


or a different function?


That was part my question I posted I did not found a way of doing it at Malli. But it is fairly easy to do using m/children. If you have a look at my other;cid=CLDK6MFMK on this channel, I wrote a few utility methods. One of them is update-child-props. It was a first draft, I modified them since then, but even with it, you can do what you want, e.g.

(update-child-props (m/schema [:map [:y {:default 20} int?]]) :y update :default dec) 
;; => [:map [:y {:default 19} int?]]

(update-child-props (m/schema [:map [:y {:default 20} int?]]) :y assoc :limit 50)           
;; => [:map [:y {:default 20, :limit 50} int?]]


Unless I misunderstood "allow to set the properties and schema of a key" 😅



  [:map [:y {:old true} int?]] 
  [:y {:new true}] string?)
; => [:map [:y {:new true} string?]]


aha, thanks!


Hi, I posted this in the #reitit channel but still did not get any response. No reply on the issue I opened either. Since it is Malli related, I thought perhaps I could get some feedback here. Thanks.


@itaysabato I can take a look at that today/tomorrow


Good morning 🙂 Any news regarding this issue?


totally forgot, sorry. will try to look later today.

👍 2

did a PR, might fix it. Depending on the exceptations


Thank you for this! Looks like it did. I commented on one line that I didn't get, but the rest looks solid to me.


answered. I'm not near computer, if you could verify the old behavior (does it strip extras or not), would help. Thanks.


Sorry, I was away for a few days. Is it still relevant to test the old strip keys behavior? I will soon try the fixed version


@ikitommi That would be lovely, thank you!


quick poke on instrumentation:! will now collect function schemas from all public vars from all loaded namespaces.


I would like to add Var-watches too, so any Var change would re-trigger instrumentation of that Var. But didn’t work in the 30min timebox I had for it.


anyway, dx should be better than before. feedback welcome on the instrumention. If anyone has tried that…


goal is to do the first version of pretty error reporting for 0.6.0, to celebrate the two year birthday of the initial demo of that ( Making open source 1h here and there isn’t the fastest way to finish stuff 😎

🎉 9
Noah Bogart14:07:51

hey all, just started using malli in a new part of my project, and i’m struggling to check if a value is a function

Noah Bogart14:07:06

(def Step
  [:map {:closed true}
   [:uuid uuid?]
   [:continue-fn fn?]
   [:complete? boolean?]
   [:phase keyword?]])


should work


fn? was added few days ago thou, it was missing. you should depend on the latest sha

Noah Bogart14:07:02

ah that’s probably it, i’m using the clojars version


[:fn fn?] works also. :fn is the escape hatch, “any function”

👍 3
Noah Bogart14:07:23

that works! thanks so much

👍 3

immutable clojars-snapshot of the latest stuff:

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

Noah Bogart14:07:18

missed that there were further docs, i’ll read over that now