8467 shaares
203 private links
203 private links
Parsing increases the information in the type system. A list can be of type NonEmpty, i.e. there is at least one element.
Use a data structure that makes illegal states unrepresentable.
Push the burden of proof upward as far as possible, but no further.
and awesome guidelines to follow.
So parse "data" and return the closest type instead of only validate them.