4 ms·
As they said in README, it’s inspired by Alex King’s Parse, don’t validate [1]. Basically, rather than write a validation function, write a parser that returns
by jinwoo68 5y ago
As they said in README, it’s inspired by Alex King’s Parse, don’t validate [1].
Basically, rather than write a validation function, write a parser that returns a result of a specific type and use that type everywhere else. Then you can make sure the raw inputs are always validated.
[1] https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/ https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...
- anaerobicover 5y agoSmall correcting, the author is named Alexis
- jinwoo68 5y agoWhoops. Thanks for correcting.