Michael Long
1 min readAug 23, 2019

--

You can accomplish this with the existing operators and without defining new ones…

if let result = try? divide(1000, 10)
.flatMap({ divide($0, 10) })
.get() {
print(result)
}

I described flatMap Result propagation in Swift 5: How to do Async/Await with Result and GCD.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)