Fork me on GitHub
#clojure-spec
<
2024-04-28
>
john13:04:17

I'm working on this new transformer thing that lets you build functions using data and I added a behavior that can spec check data while it's being constructed. What do y'all think about this transformer/spec api? It basically accumulates more and more spec constraints as transformers are derived from each other. Here you can see a transformer map that won't let a particular key be dissoc'ed from itself because of its spec: https://github.com/johnmn3/step-up/blob/main/src/step_up/alpha/transformer.cljs#L196 Any recommendations on how best to compose together specs from different map specs in an ad hoc manner? I'd like to keep it as an "open" system by default.

john13:04:53

I guess I'll want to make the spec checking an option that can be turned off in prod or whathaveyou

john13:04:37

Please ignore the ugliness of the error messages - those are temporary and were just for testing right now

john14:04:08

Is there prior art here? Where you can instrument the data itself? Or is this a new thing? And, if it's new, is it bad or good?

john14:04:42

Well I guess there's only one way to find out 🙂