Runtime data validation using schema
Like JavaScript, ClojureScript is dynamic; no type declarations are required, and attempting to provide them doesn't really give much meaningful support since ClojureScript's close relationship with the Google Closure compiler ensures your applications will already be fairly optimized when such type-related optimizations are available.
However, there are reasons you might want to have type checking as part of your program that aren't performance oriented. For instance, you might want to do input validation, or you might need to ensure that your functions are correctly passing the right data to each other in a test environment. For essentially all scenarios in which you might want to do runtime data validation, Prismatic's schema
library is the perfect fit.
At a high level, the schema
library provides functionality for data validation, function annotation, and coercion. It is an invaluable tool when it comes to making runtime assertions about programs and...