Transforms a Result into a Maybe. Error values are lost in the process.
This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.
Transforms a Result into a Maybe. Error values are lost in the process.
const Result = require('folktale/result');
const Maybe = require('folktale/maybe');
Result.Ok(1).toMaybe();
// ==> Maybe.Just(1)
Result.Error(1).toMaybe();
// ==> Maybe.Nothing()
toMaybe() {
return require('folktale/conversions/result-to-maybe')(this);
}