Skip to content

Result types

coder (π, π) edited this page Aug 22, 2023 · 2 revisions

Result type are one of core functional feature of SharpX.

These are designed to mitigate the use of null values and exceptions to drive the program flow. Since C# (for which the library is primarily designed) is multi-paradigm language you should not completely try to avoid nulls and exceptions.

The author of the library himself fell in this integralism in the past and with maturity has come to conclusion that being purely functional in every part of your code design is not practical nor technically correct choice. After all also F# itself although it is mainly functional-oriented can be defined as multi-paradigm language.

Said that as more values flow from method to method embracing functional paradigm, as more your program will be close to a mathematical expression: inheriting its predictably of output in regard to a give input.

Types overview

TODO...

Clone this wiki locally