Re:Functional exceptionless error-handling with optional and...
by Shoothe on Sunday December 03, 2017 @02:31PM
(#15839045)
But if you already have null then the method could return null, empty optional or optional with value.
[ Parent
| on HN ]
Re:Functional exceptionless error-handling with optional and...
by HumanDrivenDev on Sunday December 03, 2017 @03:53PM
(#15839527)
I don't know about C++, but for example Java has a method "ofNullable" that will convert a null to a None option.
But yes, that could potentially happen. IIRC that problem exists in many languages, including F# and Scala. Not sure how big of an issue it is in practice...