Result
Return type of a computation that could fail.
Result has two subclasses, Success and Failure. Success is used for successful computations. Failure is used for computations that have failed.
Result is dependent on two generic parameters; Error
and Value
. Error
is a type that distinguishes between the kind of failures that could occur. Value
is the type of successful computations.
Although Result is a sealed class and can be safely switched over, the idiomatic use is to build up a chain of results with the methods on this class. For an extended example check out this projects wiki.
See also
Parameters
Error
the type that indicates which errors can occur.
Value
the type of a successful computation
Functions
andThen
Link copied to clipboard
andThenError
Link copied to clipboard
orThrowException
Link copied to clipboard
withDefault
Link copied to clipboard