# Ordered collection diffing

**URL:** <https://forums.swift.org/t/ordered-collection-diffing/18933>\
**Category:** Pitches\
**Tags:** collection\
**Created:** [December 19, 2018, 4:50am UTC](https://forums.swift.org/t/ordered-collection-diffing/18933 "2018-12-19T04:50:10Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![jawbroken](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jawbroken](https://forums.swift.org/u/jawbroken)\
**Post date:** [December 21, 2018, 3:21am UTC](https://forums.swift.org/t/ordered-collection-diffing/18933/35 "2018-12-21T03:21:58Z")

</div>

I want to preface this by saying that I think that diffing methods would be a great addition to the standard library, I only disagree with mingling this with the ordered collection issue.

> [@numist](#):
>
> As far as I know it would be the first order-dependant method on `Collection` that is completely unusable with `Set` and `Dictionary` .

Depends what you mean by “on `Collection`” but there are [several methods inherited from `Sequence`](https://forums.swift.org/t/is-a-set-a-sequence/11715/54) that are very difficult to think of a reasonable use for.

> [@numist](#):
>
> The introduction of `OrderedCollection` is only supposed to be the beginning of a solution, with further reorganization to follow in future proposals as you suggest.

This seems like the wrong order to me. It hasn't been decided that `OrderedCollection` is the right way to address this issue, so making this proposal contingent on `OrderedCollection` entangles the two issues unnecessarily (and, in my opinion, counterproductively).

> [@Joe\_Groff](#):
>
> While I can see that point of view, it would also mean that Set and Dictionary lose a lot of useful generic API they get from Collection, and taking that conformance away now would be a pretty disruptive compatibility change. Having a protocol for meaningfully-ordered collections seems like a good idea to me so that APIs going forward have the opportunity to make this distinction.

Sure, I don't want to push for a particular solution here, or really discuss it at all, I'm only arguing that this proposal is the wrong level to make this decision at because it has much broader implications for a controversial topic. I would really prefer either that the “ordered” collection question is discussed/solved before it's decided where these diffing methods should live, or that this proposal ignores that orthogonal issue entirely and leaves it to be dealt with holistically later.

---

_[View the full topic](https://forums.swift.org/t/ordered-collection-diffing/18933)._
