<div dir="ltr"><span><div>I see a handful of issues like the following coming about because of changes to `Range`. In the past `Range` conformed to `Collection` so `count` came from `Collection` which returned a type of `ForwardIndex.Distance` (e.g. `_SignedInteger`). It now comes from `Strideable`’s `distance(to:)` which returns `Strideable.Stride` (e.g. `SignedNumber`).</div><div><br></div><div>error: value of type &#39;C.Index.Stride&#39; has no member &#39;toIntMax&#39;</div><div>  let len = range.count.toIntMax()</div><div>            ~~~~~~^~~~~ ~~~~~~~~</div><div><br></div><div>Additionally when trying to provide `Strideable` optimized `Collection` default implementations I hit issues like the following (note `Collection.IndexDistance` minimally conforms to SignedInteger). I picked `Strideable` as the optimization point since `RandomAccessCollection.Index` minimally conforms to `Strideable` and `Strideable` provides the first level of possible optimizations after `Comparable`.</div><div><br></div><div>extension Collection where Index : Strideable {</div><div>  public func next(i: Index) -&gt; Index {</div><div>    return i.advanced(by: 1) &lt;— this is ok</div><div>  }</div><div>  public func advance(i: Index, by n: IndexDistance) -&gt; Index {</div><div>    return i.advanced(by: n) &lt;— this errors</div><div>  }</div><div>…</div><div>}</div><div><br></div><div>error: cannot invoke &#39;advanced&#39; with an argument list of type &#39;(by: Self.IndexDistance)&#39;</div><div>    return i.advanced(by: n)</div><div>             ^</div><div>note: expected an argument list of type &#39;(by: Self.Index.Stride)&#39;</div><div>    return i.advanced(by: n)</div><div><br></div><div>Looking at things (see below ASCII art) I see that `_SignedInteger` conforms to `SignedNumber `(and `SignedInteger` conforms to `_SignedInteger`). `SignedNumber` doesn’t provide toIntMax nor can it act as an `SignedInteger`. The use of `SignedNumber` in `Strideable` is hence problematic. I guess the reason for `SignedNumber` is to let distances in Strideable support non-integer types?</div><div><br></div><div>I am not sure the best path forward at the moment. Do I attempt to scope things to `Strideable` where `Stride : SignedInteger` since `Collection.IndexDistance` – as currently defined – doesn’t allow for non-integer types? I am not sure the allowable scoping for Range in that situation? ...or do we change `Strideable.Stride` to minimally conform to `SignedInteger`? ...or?</div><div><br></div><div>Pardon my naïvety in this area of things,</div><div>-Shawn</div><div><br></div><div>————————————————————————————————————————</div><div>Equatable</div><div>  ^</div><div>Comparable</div><div>  ^</div><div>Strideable (associatedtype Stride : SignedNumber) -&gt; advanced(by:Self.Stride) &amp; distance(to: Self)</div><div>  ^</div><div>  ^              SignedNumber</div><div>  ^                 ^</div><div>Integer &amp; _SignedInteger —&gt; func toIntMax()</div><div>  ^</div><div>SignedInteger —&gt; func toIntMax()</div><div>————————————————————————————————————————</div><div>Indexable (associatedtype Index : Comparable)</div><div>  ^</div><div>Collection (associatedtype IndexDistance : SignedInteger)</div><div>  ^</div><div>BidrectionalCollection</div><div>  ^</div><div>RandomAccessCollection (associatedtype Index : Strideable)</div><div>————————————————————————————————————————</div><div>MutableIndexable (associatedtype Index : Comparable)</div><div>  ^</div><div>  ^    Collection</div><div>  ^       ^</div><div>MutableCollection (associatedtype IndexDistance : SignedInteger)</div><div>————————————————————————————————————————</div></span></div>