Other Functions

isOk

Returns true if the value is Ok, otherwise returns false.

Function Signature

Result<_> -> bool

isError

Returns true if the value is Error, otherwise returns false.

Function Signature

Result<_> -> bool

sequenceAsync

Converts a Result<Async<'a>, 'b> to Async<Result<'a, 'b>>.

Function Signature

Result<Async<'a>, 'b> -> Async<Result<'a, 'b>>

traverseAsync

Converts a Result<'a, 'error> to Async<Result<'b, 'error>> by applying the given function to the Ok value.

Function Signature

setError

Replaces an error value with a custom error value

Function Signature

withError

Replaces a unit error value with a custom error value. Safer than setError since you're not losing any information.

Function Signature

defaultValue

Returns the contained value if Ok, otherwise returns the provided value

Function Signature

defaultError

Returns the contained value if Error, otherwise returns the provided value

Function Signature

defaultWith

Returns the contained value if Ok, otherwise evaluates the given function and returns the result.

Function Signature

valueOr

Returns the Ok value or runs the specified function over the error value.

Function Signature

ignore

Ignores the value of the input result and returns unit instead

Function Signature

ignoreError

Same as defaultValue for a result where the Ok value is unit. The name describes better what is actually happening in this case.

Function Signature

Last updated