Skip to content

Commit 0acd49c

Browse files
Take advantage of GFM footnotes in the README.
1 parent 1b3e3f1 commit 0acd49c

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ These modules fall broadly into two categories:
1111
There is some overlap between these two categories, and an API that begins in the first category may migrate into the second as it matures and new uses are discovered.
1212

1313
Swift Numerics modules are fine-grained.
14-
For example, if you need support for Complex numbers, you can import ComplexModule¹ as a standalone module:
14+
For example, if you need support for Complex numbers, you can import ComplexModule[^1] as a standalone module:
1515

1616
```swift
1717
import ComplexModule
@@ -115,26 +115,26 @@ Questions about how to use Swift Numerics modules, or issues that are not clearl
115115

116116
## Notes
117117

118-
¹ Swift is currently unable to use the fully-qualified name for types when a type and module have the same name (discussion here: https://forums.swift.org/t/pitch-fully-qualified-name-syntax/28482).
119-
This would prevent users of Swift Numerics who don't need generic types from doing things such as:
120-
121-
```swift
122-
import Complex
123-
// I know I only ever want Complex<Double>, so I shouldn't need the generic parameter.
124-
typealias Complex = Complex.Complex<Double> // This doesn't work, because name lookup fails.
125-
```
126-
127-
For this reason, modules that would have this ambiguity are suffixed with `Module` within Swift Numerics:
128-
129-
```swift
130-
import ComplexModule
131-
// I know I only ever want Complex<Double>, so I shouldn't need the generic parameter.
132-
typealias Complex = ComplexModule.Complex<Double>
133-
// But I can still refer to the generic type by qualifying the name if I need it occasionally:
134-
let a = ComplexModule.Complex<Float>
135-
```
136-
137-
The `Real` module does not contain a `Real` type, but does contain a `Real` protocol.
138-
Users may want to define their own `Real` type (and possibly re-export the `Real` module)--that is why the suffix is also applied there.
139-
New modules have to evaluate this decision carefully, but can err on the side of adding the suffix.
140-
It's expected that most users will simply `import Numerics`, so this isn't an issue for them.
118+
[^1]: Swift is currently unable to use the fully-qualified name for types when a type and module have the same name (discussion here: https://forums.swift.org/t/pitch-fully-qualified-name-syntax/28482).
119+
This would prevent users of Swift Numerics who don't need generic types from doing things such as:
120+
121+
```swift
122+
import Complex
123+
// I know I only ever want Complex<Double>, so I shouldn't need the generic parameter.
124+
typealias Complex = Complex.Complex<Double> // This doesn't work, because name lookup fails.
125+
```
126+
127+
For this reason, modules that would have this ambiguity are suffixed with `Module` within Swift Numerics:
128+
129+
```swift
130+
import ComplexModule
131+
// I know I only ever want Complex<Double>, so I shouldn't need the generic parameter.
132+
typealias Complex = ComplexModule.Complex<Double>
133+
// But I can still refer to the generic type by qualifying the name if I need it occasionally:
134+
let a = ComplexModule.Complex<Float>
135+
```
136+
137+
The `Real` module does not contain a `Real` type, but does contain a `Real` protocol.
138+
Users may want to define their own `Real` type (and possibly re-export the `Real` module)--that is why the suffix is also applied there.
139+
New modules have to evaluate this decision carefully, but can err on the side of adding the suffix.
140+
It's expected that most users will simply `import Numerics`, so this isn't an issue for them.

0 commit comments

Comments
 (0)