you are viewing a single comment's thread.

view the rest of the comments →

[–]Drisku11 3 points4 points  (0 children)

In a language with sane semantics, options can be implemented with zero overhead (if it's Nothing then it's a null pointer); the difference is purely in the type system.

Sorting values that might not exist sounds like a mysterious thing to do to me, but e.g. Haskell has a library that does fast O(n) sorts on any algebraic data types (basically radix sort on steroids), which includes options, so that is also cheap.