I’m finding Combine's Future publisher to useful as an API surface because by definition it produces zero or one values then finishes. If a function returns a future, the caller implictly knows it will only ever return a single value. I can use AnyPublisher and get essentially the same result, but I lose the self documenting aspect of supplying a single shot publisher.
In some cases, I have a function consuming a future and returning a new future with an adjusted type. With a type like Result I can map one type to another, but Future.map returns a Publishers.Map type leading me back to AnyPublisher for my API. Is there a good way to map Future<Output, Failure> to Future<NewOutput, Failure>?
Thanks,
Nick
* apologies for posting a beta framework related question in the language forum, but I can’t find a better place for it