You can understand the need for a common-prefix count and the differing element values, but you need a method to return all three when the sequence is single-pass. Would a return of:
(offset: Int, patch: (Element?, OtherSequence.Element?))
look better? It's reminiscent of Sequence.enumerated
and zipSequence
, along with Unix diff
. Although the name "patch" works better when both sub-elements are non-nil
.
Speaking of zipSequence
, I saw another thread of zipLongest
, and it's neat. The current zip-sequence system seems like it would almost work for diverges
, but its information on the end of the sequences is wrong. What zipLongest
provides is better for this work.