Choice Maybe<T>
Holds either a value or an Error
. Maybe
is intended for use as a return type for a method which
returns a value, but is not always guaranteed to succeed.
- Source Code:
- View Source
Case Summary
Inherited Fields:
Instance Method Summary
get ():T - Returns the result of a successful call.
error ():Error - Returns the error message of a failed call.
succeeded ():Bit - Returns
true
if the call succeeded.
Cases
A successful call with return value.
An error occurred.
Instance Methods
@pre(succeeded())
function get
():T
Returns the result of a successful call.
@pre(!succeeded())
function error
():Error
Returns the error message of a failed call.
function succeeded
():Bit
Returns true
if the call succeeded.