foldFuture<TR> method
Implementation
Future<TR> foldFuture<TR>(Future<TR> Function(Iterable<Fail> failures) invalid,
Future<TR> Function(T val) valid)
{
return then((value) => value.fold((failures) => invalid(failures).then((value) => value),
(val) => valid(val).then((value) => value)));
}