18 public function isOK();
27 public function value();
42 public function error();
60 public function map(callable
$f);
73 public function then(callable $f);
87 public function except(callable $f);
then(callable $f)
Get a new result from the callable or do nothing if this is an error.
isOK()
Get to know if the result is ok.
valueOr($default)
Get the encapsulated value or the supplied default if result is an error.
value()
Get the encapsulated value.
isError()
Get to know if the result is an error.
except(callable $f)
Feed the error into a callable and replace this with the result or do nothing if this is a value...
A result encapsulates a value or an error and simplifies the handling of those.
map(callable $f)
Create a new result where the contained value is modified with $f.
error()
Get the encapsulated error.