Exvalibur is the generator for blazingly fast validators of maps based on sets of predefined rules.
Under the hood, it generates a module with many different clauses of the same valid?/1 function with explicitly hardcoded pattern matches and guards on the input.
Where exactly? Do you mean a validator module generation? If yes, I can assure you it is worth it: we use it in production for several months and it shows itself
Depending on input, it runs 10β1000 times faster than standard validations.
True that, but I struggled to find a better name to be short and self-explanatory. OTOH, I do not want to miss the opportunity to return what was indeed validated on success.
Maybe I should go with validate/1 to return what valid?/1 currently returns and valid?/1 to return boolean.
It surely is. The only thing that prevents me of doing it straight away is itβs breaking change. I probably will go with deprecation warnings and validate/1 doing exactly what valid?/1 does now and change the behaviour of valid?/1 to return boolean as of v1.0.0.
Can you give an example on how would you use Exvalibur to validate lists without using custom validators? Say, I allow only one instance of several different structs in it, and then I allow anywhere from 1 to 5000 instances of another struct, and another struct can only appear zero or one times, etc.
I am aware I can write my own custom validators for it. I am asking if you plan on adding validation of lists of maps/structs.
Is it implied by XSD? I am asking because next major update would be to support XSD as a validator definition.
If not, could you please fill in the issue? I am positive that is a great feature even outside of XSD parsing, so Iβd implement it in any case. We might discuss the syntax for this, but Iβd strongly appreciate doing this in github for the sake of reference/history.