As you know, in Chapter 12, Futures, Promises, and Reactive Programming, we created a streamlined implementation of futures and promises packaged as an Xcode playground. That code is certainly a good candidate for extracting a framework that we can reuse in other projects. The playground mixed the futures and promises implementation with the code using it. So our first refactoring step is keeping just the futures and promises implementation and removing the rest, which is highlighted in italics in the following snippet (to keep the listing short, we have left only the signatures of the functions to be removed):
public enum Result<Value> { case success(Value) case failure(Error)}enum SimpleError: Error { ... }typealias ...