3 ms·
It's just another name for Null in practice. Or a "typed null" to be more precise. It's got some nice properties, but really it's the good old tri-state. As th
by viraptor 9y ago
It's just another name for Null in practice. Or a "typed null" to be more precise. It's got some nice properties, but really it's the good old tri-state.
As the op says - is a "logic-variant of Null"
- annabellish 9y agoThat style of "null" has a _lot_ of advantages over the common null found today. The perfect is the enemy of the good - Option/Maybe types aren't perfect, but they're a lot better than null references.
- tomasz_bekas 9y ago>really it's the good old tri-state Yes it is, the point they make is that Option<Boolean> is explicitly tri-state in contrast to regular Boolean which should be two-state.
- dragonwriter 9y ago> It's just another name for Null in practice. No, it's not. > Or a "typed null" to be more precise. To the extent this is true, it is a fundamental difference. > It's got some nice properties, but really it's the good old tri-state. No, it's not. Because the Boolean type contains only True and False, not Null and the Option<Boolean> type (likewise, Option<Option<Boolean>>, etc.) does not contain True or False. There's no weirdness in doing logic operations on an Option<Boolean>, or a pair of them, because it is a type error to attempt it because Option<Boolean> is not Boolean.
- viraptor 9y agoSure, they're different things. The comment wasn't meant to be in vacuum, but as a response to option being a better logic 3-state. I agree that for other reasons it's better, but conceptually they are used to represent the same thing. (Logic variant of null)