| 382 | } |
| 383 | |
| 384 | result<Ints, string> parse_content(const string& content) |
| 385 | { |
| 386 | const auto maybe_values = fwd::apply(content, fwd::split(',', false), fwd::transform(read_value<int>)); |
| 387 | if (all_by(is_just<int>, maybe_values)) |
| 388 | return ok<Ints, string>(justs(maybe_values)); |
| 389 | else |
| 390 | return error<Ints, string>("Can not parse file."); |
| 391 | } |
| 392 | |
| 393 | result<int, string> calc_median(const vector<int>& xs) |
| 394 | { |