malli

2025-09-02T17:40:39.040319Z

I received funding to work on Malli this quarter. Here's my proposal, first I'll finish the constraint work I almost finished earlier this year. https://www.clojuriststogether.org/news/q3-2025-funding-announcement/#ambrose-bonnaire-sergeant-malli

👏 8
đź‘€ 1
🔥 3
2
3
🎉 5
2025-09-03T16:27:49.473469Z

@ben.sless Good question, tbh I haven't thought about this in 6 months. I didn't expect it to be picked up for funding. I'm ramping myself back on, I'll keep you posted.

2025-09-03T16:28:42.658009Z

There's code somewhere which I will share.

2025-09-03T16:31:01.028849Z

Here's the full original proposal with code and idea sketches https://gist.github.com/frenchy64/ea0fd37c3cd4d2063342edf4ae3c80e3

Ben Sless 2025-09-03T16:37:03.953859Z

I'll leave comments there

👌 1
Ben Sless 2025-09-03T16:57:19.741949Z

comments left

Ben Sless 2025-09-03T16:58:08.369519Z

🔥 2
Ben Sless 2025-09-03T06:49:42.468829Z

Using this opportunity to discuss - how do you plan to achieve a canonical representation and simplification algorithm that given different shaped schemas will reach the same ground form? Reminds me of some problems from LC expression reduction

opqdonut 2025-09-25T09:47:34.604019Z

note to self: I should look into this and offer my comments as well

Ben Sless 2025-09-25T10:02:18.171629Z

2025-09-25T16:22:48.789289Z

Thanks. It'll be a while until I get started, I intend to work on my open PR's first.

Andrey Subbotin 2025-09-02T03:39:14.896539Z

Say, I’ve an fn declared in a defprotocol:

(defprotocol MyProtocol
  (do-this [x] "blah blah"))
I wanted to add a schema for this do-this fn, to ensure the implementers do the right thing:
(m/=> do-this [:=> [:cat :string] :string])

(defprotocol MyProtocol
  (do-this [x] "blah blah"))
I have the instrumentation enabled and all other fns seem to be handled fine, but this doesn’t seem to be applied to fns implemented as part of a protocol… how do I define a schema for a protocol fn?

2025-09-02T14:08:58.201779Z

that's been a recommended way to do protocols for a while! ben vandergrift and alex miller wrote about that in their book Clojure Applied 10 years ago

🙏 1
Andrey Subbotin 2025-09-02T03:51:35.245319Z

Did a bit of research and it seems it’s not supposed to work as per https://github.com/metosin/malli/issues/555

Andrey Subbotin 2025-09-02T04:16:37.947119Z

Are there possible workarounds?

Andrey Subbotin 2025-09-02T05:22:05.746849Z

I ended up creating a schemed wrapper function that calls the protocol method:

(defprotocol MyProtocol
  (-do-this [x] "internal implementation"))

(m/=> do-this [:=> [:cat :string] :string])
(defn do-this [x]
  (-do-this x))

(defrecord MyRecord [data]
  MyProtocol
  (-do-this [x] (str "processed: " (:data x))))