A collection of tools for dealing with nulls, failures and the generic type issues that arise in this domain.
https://github.com/Andy3432344/SafeResults
I’m the author, let me know what you think!
*Edit: updated to show GitHub link, sorry!
A collection of tools for dealing with nulls, failures and the generic type issues that arise in this domain.
https://github.com/Andy3432344/SafeResults
I’m the author, let me know what you think!
*Edit: updated to show GitHub link, sorry!
Nulls are famously called the billion dollar mistake, and for good reason.
Option types are the answer to that problem, because they make the optionality explicit and require one to handle it or propagate it.
That being said: as someone that does functional programming professionally, this looks kinda janky, to me. But the good news is that C# is actually adding support for discriminated unions finally (seriously, it’s been waaaay too damn long): https://github.com/dotnet/csharplang/blob/18a527bcc1f0bdaf542d8b9a189c50068615b439/proposals%2FTypeUnions.md
With discriminated unions, you can finally comfortably work with Option/Result types natively.