The problem comes because you have to either use a single error for two parts or deal with a tough explosion of types. No?
But as I've said, yeah you can do this. But it's unfortunate because it destroys a lot of information that's useful in the type signature. Haskell does this with exception hierarchies and some clever runtime casting attempts, but even that has ergonomic issues.
What'd be really amazing is if we could get the totality checking of pattern matching but also the composability of exception handlers, and that's what the next generation of error handling primitives are trying to do.
The combination of data and lookup is more like data(lookup(default)), which in haskell (assuming we could encode the error type neatly):
load =<< lookup "default".
So Result3's first parameter is of type Data.> You probably don't really care about the exact error that can be thrown by either handler, you just need enough information to display a sensible message to the user.
Please consider looking for the part of the article we're discussing where it says, "However, adding that extra type information to our result type does have some nice benefits - for example, it lets us specifically handle all possible errors at the call site, like this"
Ultimately we'd like to get to where the compiler can do at least a rudimentary totality check on the error handler.
P.S., I know my prose is rambling and my code is overly verbose, but please consider how it makes me feel when you give me suggestions I myself discussed in the prior post.
After doing that, the type of Handler3 can be had as Result<Tuple<Data, Address>, NSError>, for example. And how do you combine the two results into the Tuple? That's an applicative, I'm sure swift provides combinators to do just that.