std::optional<std::string> FindUsersCity(bool non_default) {
  return GetOrOpenContactsServerConnection()
      .transform([](auto&& contacts) { return contacts->GetUserId(); })
      .and_then([](auto&& uid) {
        return GetOrOpenGeoServerConnection().transform(
            [&uid](auto&& geo) { return geo->GetLocation(*uid); });
      })
      .transform([](auto&& uloc) { return uloc->GetCityName(); });
}

Isn't it too low-level? How well does it capture intent and how readable it is? I do not think I want to transform anything (I just want to have a couple of checks)...

--
Dmitry
Sent from gmail