|
|
|
|
|
by dwattttt
283 days ago
|
|
Sibling says this with code, but to distil the advice: reflect the result of your validation in the type system. Then instead of validating a loose type & still using the loose type, you're parsing it from a loose type into a strict type. The key point is you never need to look at a loose type and think "I don't need to check this is valid, because it was checked before"; the type system tracks that for you. |
|
I still wouldn't need to check the inputs again because I know it's already been processed, even if the type system can't help me.