Create an instance of Err
.
const anErr = Result.err('alas, failure');
Create an instance of Err
.
const anErr = Result.err('alas, failure');
The value to wrap in an Err
.
Create an instance of Ok
.
Note that you may explicitly pass Unit
to the ok
constructor to create a Result<Unit, E>
. However, you may not call the
ok
constructor with null
or undefined
to get that result (the type
system won't allow you to construct it that way). Instead, for convenience,
you can simply call
, which will construct the
type correctly.Result.ok()
The value to wrap in an Ok
.
The public interface for the
Result
class as a value: the static constructorsok
anderr
produce aResult
with that variant.