3 ms·
That makes more sense, although I can’t say that "many booleans are guards for the presence (or validity) of a value" matches my experience.
by layer8 5y ago
That makes more sense, although I can’t say that "many booleans are guards for the presence (or validity) of a value" matches my experience.
- mdpye 5y agoMany of those booleans aren't necessarily named. Any "is(n't) null" check on a nullable includes a boolean expression. That's quite a few booleans right there. Using an optional (and accessing it with either fmap or a match expression) removes the value from the scope of the "wasn't present" branch, eliminating a possible source of mistakes. Using an optional with an isPresent test does not. And you see that boolean pop up again in the return of that method. I think that's what they're getting at.