3 ms·
«Throw an exception» Runtime is too late to find bugs.
by catnaroek 11y ago
«Throw an exception»
Runtime is too late to find bugs.
- pron 11y agoThat's not what I meant. The presence of an exception in the constructor proves that an invalid `Email` instance can't exist in any expression.
- catnaroek 11y agoThat's assuming that exceptions show up in type signatures. (Which they do in Java, granted.) And it's still incredibly noisy compared to pattern matching on Options/Eithers or, even better, chaining them Kleisli Option/Either arrows.