Result is just an example. This goes for any type that is generic, and when the you use Void as one of the type parameters.
However, in my case, I have lots of functions that work with Result. An entire HTTP client library. Lots of generic functions, and stuff to automatically deserialize json, etc.
It makes little sense to have some functions work with Result-based callbacks and other with Error?-based.
Result implements map, flatMap, convenience functions to turn a Result<U?, T> into Result<U, UnwrapError<T>> and so on.
I have built a Promise library on top of it, with Promise.promisify static functions for up to arity 4 to turn any function get(a: A, b: B, c: C, completion: (Result<U,T>) -> Void) into a get(a: A, b: B, c: C) -> Promise<U, T>.
It makes no sense to sometimes use a completely different type, such as Error?.
But sometimes, it does make sense to return Result<Void, _> and have it be Equatable. Maybe my generic response cache mechanism wants to do equality tests for some reason, etc.
How do I make it equatable? I can’t create two conditional conformances for a type even with different specializations.