Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Commit 706f2eb

Browse files
author
Bryan C. Mills
committed
typelist: clarify comments in examples
1 parent 798a889 commit 706f2eb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

typelist.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ dynamic types for values stored _in_ the constraint type”. (However, note that
202202
this constraint has a well-defined meaning even for types that are not sum
203203
types.)
204204
205-
```go
206-
func
207-
```
208-
209205
## Examples
210206
211207
With the orthogonal approach, the examples in the draft design become a bit more
@@ -228,7 +224,8 @@ func Smallest(type T in constraints.Ordered)(s []T) T {
228224
229225
```go
230226
// StringableSignedInteger is an interface type implemented by any
231-
// type that both 1) is defined as a signed integer type, and
227+
// type that both 1) is defined as a signed integer type
228+
// (or a sum type comprising signed integer types), and
232229
// 2) has a String method.
233230
type StringableSignedInteger interface {
234231
type int, int8, int16, int32, int64
@@ -300,6 +297,8 @@ type Numeric interface {
300297
complex64, complex128
301298
}
302299
300+
// GeneralAbsDifference computes the absolute difference between two values
301+
// of any concrete integer type T.
303302
func GeneralAbsDifference(type T in Numeric)(a, b T) T {
304303
// T is a concrete type, so *T can be converted to *Underlying(T).
305304
// The set of possible types for T is infinite (any defined integer type),

0 commit comments

Comments
 (0)