3 ms·
Most Clojure teams I speak to spec their input using Clojure spec, then they get custom recursive error reporting, validation, coercion and generators Clojure
by slifin 7y ago
Most Clojure teams I speak to spec their input using Clojure spec, then they get custom recursive error reporting, validation, coercion and generators
Clojure specifications can also be converted into other forms of specification like graphql schema, database schema, json schema etc
The best I've seen a type system do on user input is blow up at runtime and that's not good enough for me
- yakshaving_jgt 7y ago> The best I've seen a type system do on user input is blow up at runtime and that's not good enough for me Then you haven’t been looking closely enough. The article addresses exactly this wrong argument.
- samatman 7y agoDoes it? What happens to the example code if UserName is an Int?
- yakshaving_jgt 7y agoThe article demonstrated that with Haskell — as with just about any other language — you can choose to silently ignore malformed input. There is absolutely no fundamental necessity to "blow up at runtime" as the parent comment erroneously posited.