I get that Missing and Nothing serves different purposes. They both encode that there is no particular value available, but the former indicates that usage is permitted as long as it is consistent with the multivalued state space (e.g,
true || missing = true) while the latter indicates that usage is not permitted (most operations on
nothing fail). A slightly contrived example of these two usecases are found within mathematics:
- no particular real value can be assign to sqrt(-1) because none of them solve x^2 = -1 (so one may return
nothingor fail if restricted to reals).
- no particular real value can be assign to 0/0 because they all solve 0*x = 0 (so one may return
One may observe that a single float-point value,
NaN, covers both cases in the IEEE standard. I love the fact that Missing and Nothing are independent from other types (unlike
NaN), but why do we need two of them? Can you find examples where merging the two types into one would cause any significant difficulty or confusion?
Rough summary can be found at post #20.