3 ms·
> Although you eliminate null pointer exceptions, lazy evaluation does introduce another subtle and very similar class of errors. But those are completely diff
by masklinn 16y ago
> Although you eliminate null pointer exceptions, lazy evaluation does introduce another subtle and very similar class of errors.
But those are completely different features, option types don't imply lazy evaluation (and the other way around). OP didn't talk about lazy evaluation once. There might be issues with lazy eval, but that's completely not the subject.
- deleted 16y ago[deleted]
- Chirono 16y agoYeah, I know they aren't related. I just thought it might be interesting to show that this kind of bug can still crop up even without nullable types. So the statement made at the end of the post doesn't quite hold: > In Haskell, it is simply impossible to write a program that is susceptible to NullPointerExceptions at runtime unless you explicitly make the type in question optional by wrapping with Maybe. That said, lazy knot-tying isn't something you tend to write by accident. You generally know that it's going on.