Fork me on GitHub
#clojure-spec
<
2017-03-18
>
yonatanel10:03:22

So I made this abomination. Anyone finds this useful or really unnecessary? https://github.com/yonatane/spec-grind/blob/master/test/spec_grind/grind_test.clj

tbaldridge15:03:37

@yonatanel not a super bad idea, but add an additional function to all your conformers (`s/conform can take two args), so that we can unconform as well.

yonatanel16:03:41

@tbaldridge I don't think there's a need for unform here. I use a few predefined conformers for coercion and they yield either a coerced value or ::s/invalid, and you can chain them with s/and without using unform.

yonatanel17:03:05

Unless you need the original value which wasn't a goal for this lib. Perhaps I could add it as meta of the coercion result. I never used meta so I don't know if it works for nil and primitives. Anyway it needs to go into a better thought out lib than this.