Future<Option<R>> mapFuture<R, T>(Future<R> Function(T t) f) => foldFuture( () => None().toFuture() as Future<Option<R>>, (some) => f(some! as T).then((value) => Some(value)));