Skip to main content
1 of 4
JacquesB
  • 62.4k
  • 21
  • 137
  • 190

Nulls have a significant downside in that they can't be composed.

Consider a dictionary. The lookup function may return an option: Nothing if the key does not exist, otherwise Some value. This will work with any type of value including options. If the values in the dictionary are options, the lookup will returns an option where the value (if any) is an option.

But what if a missing value is indicated by a null? Then the lookup function can return a value or a null, but there is no was to distinguish between if the null means the key did not exist or the key did exist but the associated value was null. You lose what could be important information.

JacquesB
  • 62.4k
  • 21
  • 137
  • 190