core-typed

2025-12-09T16:53:46.368929Z

I really like HHmap and its friends in TypedClojure. Has anyone thought of a run time check similar to Malli for TypedClojure? If TypedClojure could do malli/assert style assertions and generate data, I would never use anything.

2025-12-09T21:22:41.763499Z

There's some existing work. • Here's a library that converts types to Malli schemas so you can use malli operators with HMap's https://github.com/typedclojure/typedclojure/blob/main/typed/malli/README.md#validation • here's a namespace that converts types to generators https://github.com/typedclojure/typedclojure/blob/main/typed/malli/src/typed/malli/generator.cljclojure.core.typed/{pred,cast} are ways to generate assertions based on types, but I'm probably concentrating on Malli conversion from now on https://github.com/typedclojure/typedclojure/blob/4edaa0d63bb8ed9b93fa38e97bbd77f14256b39d/typed/clj.runtime/src/clojure/core/typed.cljc#L869-L919

2025-12-09T21:24:22.286159Z

👁️

2025-12-09T21:27:35.332059Z

This is very cool, thanks for sharing. Is org.typedclojure/typed.malli the future of this type of stuff in TypedClojure?

2025-12-09T21:30:06.478999Z

mostly yes. There's some things that are inexpressible in malli at the moment like polymorphic types. but the dream is that there's a one-to-one conversion to a malli schema for all types, and we can simply leverage that ecosystem for dynamic checking, Typed Clojure adding the one thing malli doesn't do, which is static checking.

2025-12-09T21:30:46.129039Z

malli is also flexible enough that we can create our own suite of schemas, e.g., a :typed.clojure/HMap schema.

2025-12-09T21:31:46.927509Z

I've attempted for several years to encode t/All as a schema but haven't nailed it yet.

2025-12-09T22:06:59.877279Z

This is very cool thanks for sharing. We have a medium to large code base at shortcut. ~250k lines. We have started to use malli, but I would love to have something more like typedcojure.

2025-12-09T22:39:10.078149Z

oh cool

2025-12-09T22:44:38.565349Z

maybe the lowest hanging fruit it to try and use malli syntax to provide types, and report any bugs you find https://github.com/typedclojure/typedclojure/tree/main/example-projects/malli-type-providers

👀 1
2025-12-09T22:47:13.203869Z

I used Claude to add many of the remaining conversions of core schemas to types https://github.com/typedclojure/typedclojure/commit/95709b3abb92389341154518be69ff2311b11a05

2025-12-09T22:49:42.867299Z

it's nice to now have schemas for t/Seqable (I contributed them to malli recently)

(:seqable :every) `(t/Seqable ~(gen-inner (first (m/children m))))