either(Term, Error) = {ok, Term} | {error, Error}
fold/2 | Fold over a term with a list of functions. |
from_bool/3 | Convert a boolean to the form {ok, Term} or {error, Error} . |
is_error/1 | Check whether the given result tuple is of the form {error, E} . |
is_ok/1 | Check whether the given result tuple is of the form {ok, V} . |
sequence/1 | Combine a list of result tuples. |
fold(Init::term(), Fs::[fun((Term) -> Return)]) -> either(Term, Error)
Fold over a term with a list of functions.
The first function in the list is called with the initial value, and
expected to produce either an either(NewValue, Error)
or a bare
NewValue
. If the produced value is an {ok, NewValue}
tuple, the
next function is called with NewValue
as its input. If the produced
value is a bare NewValue
, the next function is called with that
value as its input. If the produced value is an error, processing
stops and returns that {error, E}
tuple.
from_bool(Term, Error, X3::boolean()) -> either(Term, Error)
Convert a boolean to the form {ok, Term}
or {error, Error}
.
is_error(X1::either(Term, Error)) -> boolean()
Check whether the given result tuple is of the form {error, E}
.
is_ok(X1::either(Term, Error)) -> boolean()
Check whether the given result tuple is of the form {ok, V}
.
Combine a list of result tuples.
This will result in either an{error, E}
if any of the supplied
tuples is an error, or {ok, [V]}
with all the ok-values sequenced
into a list.
Generated by EDoc