Skip to contents

Creates a Result monad instance which can be used with the flatMap operator %>>=%. See the Monads in R vignette for more details.

This container, when flatMapped, always returns a value, either of type Err (if an error was raised or the result was NULL), or Ok.

See also

Public fields

value

value contained in the instance

Methods


Method new()

create a new Result instance

Usage

Result$new(value)

Arguments

value

value to be contained

Returns

a new Result instance


Method bind()

bind when using flatMap (%>>=%)

Usage

Result$bind(f, expr)

Arguments

f

function to apply

expr

expression of the function


Method clone()

The objects of this class are cloneable with this method.

Usage

Result$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.