3 ms·
> the type of Handler3 can be had as Result<Tuple<Data, Address>, NSError>, The combination of data and lookup is more like data(lookup(default)), which in ha
by KirinDave 8y ago
> the type of Handler3 can be had as Result<Tuple<Data, Address>, NSError>,
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.