Every time the issue comes up of conforming
Equatable — or even the broader suggestion of synthesising conformance for
Equatable for arbitrary tuples where each element is
Equatable — the discussion often results in a rabbit hole like this:
- Making structural types conform to protocols
(A, B)as sugar for e.g
- Variadic generics
… and the whole thing comes to a stop as the issue becomes too large to tackle.
I wonder: Is is possible to "hoist" the logic concerning equality up the stack somehow, and as a special case, allowing
Void to be treated as an
Equatable in generic code? Without going all the way to The Perfect Solution™?
Is it possible to somehow do this in small additive steps:
- First allow
Voidto be equatable
- Second, allowing element-wise equatable tuples to be equatable
- Full-fledged variadic generics, general protocol-conformance for structural types, etc
… where each new iteration perhaps can reimplement the former in terms of the latter?
Now that we have
Result and Combine's
Publisher etc in the mainstream, it is a real shame that we always have to special-case generic code over these types when they wrap