Fork me on GitHub

My 2c is that: this is trying to do too much with spec. I'd keep the tags simple keywords, and do the manipulation later, using spec only to suss out the implicit ordering or types into explicit data (via cat and or respectively).


I'm always torn between that and doing more. Spec feels like it's one step away from automatic transformations, with conformers being the key enabling element for this.


I can sympathise 100%


But spec's neither a kitchen sink, nor a silver bullet 😀


I think if specs supported metadata one could use simple tags and just indicate code-level stuff there. Perhaps we'll get that functionality in version 2.


I dunno if spec wants to do that. Because the awesome thing in Clojure is that, we already have namespaced keywords, which are (when correctly used) globally precise names. And this means just like spec maintains a global registry of specs attached to these names for the purpose of specification, we can write our own things which maintain global registries of other stuff attached to the same names, for use in other contexts. I think this is one of those instances where making things global makes sense, and alleviates parochiality. For this kind of a thing to be realistic though, I feel like the idea of providing and requiring contexts needs to be first class and written down in code, so that automatic verification of breakage can be detected and avoided, making way for an ecosystem that can integrate various things seamlessly while still being dynamic and "growable"


conform is designed to tell you why something was validated and separate data into parsed components


It is not a general “data transform meat grinder” and you’ll be disappointed if you try to use it that way

💯 1
👍 2