@@ -330,16 +330,16 @@ parameter polymorphism that enables polymorphic types and
330
330
functions. For example, one can implement a ``min `` function as,
331
331
e.g.,::
332
332
333
- func min<T : Ordered >(x : T, y : T) -> T {
333
+ func min<T : Comparable >(x : T, y : T) -> T {
334
334
if y < x { return y }
335
335
return x
336
336
}
337
337
338
338
Here, ``T `` is effectively a type variable that can be replaced with
339
339
any concrete type, so long as that type conforms to the protocol
340
- ``Ordered ``. The type of ``min `` is (internally) written as ``<T : Ordered > (x :
340
+ ``Comparable ``. The type of ``min `` is (internally) written as ``<T : Comparable > (x :
341
341
T, y : T) -> T ``, which can be read as "for all ``T ``, where ``T ``
342
- conforms to ``Ordered ``, the type of the function is ``(x : T, y : T)
342
+ conforms to ``Comparable ``, the type of the function is ``(x : T, y : T)
343
343
-> T ``. Different uses of the ``min `` function may have different
344
344
bindings for the type variable ``T ``.
345
345
@@ -351,7 +351,7 @@ function, and produces a monomorphic function type based on the
351
351
newly-generated type variables. For example, the first occurrence of
352
352
the declaration reference expression ``min `` would result in a type
353
353
``(x : T0, y : T0) -> T0 ``, where ``T0 `` is a fresh type variable, as
354
- well as the subtype constraint ``T0 < Ordered ``, which expresses
354
+ well as the subtype constraint ``T0 < Comparable ``, which expresses
355
355
protocol conformance. The next occurrence of the declaration reference
356
356
expression ``min `` would produce the type ``(x : T1, y : T1) -> T1 ``,
357
357
where ``T1 `` is a fresh type variable (and therefore distinct from
0 commit comments