Skip to content

Commit 2aeb3f8

Browse files
authored
Merge pull request #3 from 8bitmp3/patch-1
Unwrap text, update Swift Numerics README
2 parents f3e99a9 + ecfc4db commit 2aeb3f8

File tree

1 file changed

+18
-53
lines changed

1 file changed

+18
-53
lines changed

README.md

Lines changed: 18 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22

33
## Introduction
44

5-
Swift Numerics provides a set of modules that support numerical computing in
6-
Swift. These modules fall broadly into two categories:
5+
Swift Numerics provides a set of modules that support numerical computing in Swift. These modules fall broadly into two categories:
76

8-
- API that is too specialized to go into the standard library, but which is
9-
sufficiently general to be centralized in a single common package.
10-
- API that is under active development toward possible future inclusion in the
11-
standard library.
7+
- API that is too specialized to go into the standard library, but which is sufficiently general to be centralized in a single common package.
8+
- API that is under active development toward possible future inclusion in the standard library.
129

13-
There is some overlap between these two categories, and API that begins in the
14-
first category may migrate into the second as it matures and more users start
15-
using Swift Numerics.
10+
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 more users start using Swift Numerics.
1611

17-
Swift Numerics modules are fine-grained. For example, if you need support for
18-
Complex numbers, you can import ComplexModule¹ as a standalone module:
12+
Swift Numerics modules are fine-grained. For example, if you need support for Complex numbers, you can import ComplexModule¹ as a standalone module:
1913

2014
```swift
2115
import ComplexModule
2216

2317
let z = Complex<Double>.i
2418
```
2519

26-
There is also a top-level `Numerics` module that re-exports the complete public
27-
interface of Swift Numerics:
20+
There is also a top-level `Numerics` module that re-exports the complete public interface of Swift Numerics:
2821

2922
```swift
3023
import Numerics
@@ -36,23 +29,15 @@ Swift Numerics modules have minimal dependencies on other projects.
3629

3730
The current modules assume only the availability of the Swift and C standard libraries and the runtime support provided by compiler-rt.
3831

39-
Future expansion may assume the availability of other standard interfaces, such
40-
as [BLAS (Basic Linear Algebra
41-
Subprograms)](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms)
42-
and [LAPACK (Linear Algebra Package)](https://en.wikipedia.org/wiki/LAPACK). But
43-
modules with more specialized dependencies (or dependencies that are not
44-
available on all platforms supported by Swift) belong in a separate package.
32+
Future expansion may assume the availability of other standard interfaces, such as [BLAS (Basic Linear Algebra Subprograms)](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) and [LAPACK (Linear Algebra Package)](https://en.wikipedia.org/wiki/LAPACK). But modules with more specialized dependencies (or dependencies that are not available on all platforms supported by Swift) belong in a separate package.
4533

46-
Because we intend to make it possible to adopt Swift Numerics modules in the
47-
standard library at some future point, Swift Numerics uses the same license and
48-
contribution guidelines as the Swift project.
34+
Because we intend to make it possible to adopt Swift Numerics modules in the standard library at some future point, Swift Numerics uses the same license and contribution guidelines as the Swift project.
4935

5036
## Using Swift Numerics in your project
5137

5238
To use Swift Numerics in a SwiftPM project:
5339

54-
1. Add the following line to the
55-
dependencies in your `Package.swift` file:
40+
1. Add the following line to the dependencies in your `Package.swift` file:
5641

5742
```swift
5843
.package(url: "https://github.com/apple/swift-numerics", from: "0.0.7"),
@@ -71,30 +56,22 @@ dependencies in your `Package.swift` file:
7156

7257
## Contributing to Swift Numerics
7358

74-
Swift Numerics is a standalone library that is separate from the core Swift
75-
project. In practice, it will act as a staging ground for some APIs that may
76-
eventually be incorporated into the Swift Standard Library. When that happens,
77-
such changes will be proposed to the Swift Standard Library using the
78-
established evolution process of the Swift project.
59+
Swift Numerics is a standalone library that is separate from the core Swift project. In practice, it will act as a staging ground for some APIs that may eventually be incorporated into the Swift Standard Library. When that happens, such changes will be proposed to the Swift Standard Library using the established evolution process of the Swift project.
7960

80-
Swift Numerics uses GitHub issues to track bugs and features. We use pull
81-
requests for development.
61+
Swift Numerics uses GitHub issues to track bugs and features. We use pull requests for development.
8262

8363
### How to propose a new module
8464

8565
1. Raise an issue with the [new module] tag.
8666
2. Raise a PR with an implementation sketch.
87-
3. Once you have some consensus, ask an admin to create a feature branch against
88-
which PRs can be raised.
89-
4. When the design has stabilized and is functional enough to be useful, raise a
90-
PR to merge the new module to master.
67+
3. Once you have some consensus, ask an admin to create a feature branch against which PRs can be raised.
68+
4. When the design has stabilized and is functional enough to be useful, raise a PR to merge the new module to master.
9169

9270
### How to propose a new feature for an existing module
9371

9472
1. Raise an issue with the [enhancement] tag.
9573
2. Raise a PR with your implementation, and discuss the implementation there.
96-
3. Once there is a consensus that the new feature is desirable and the design is
97-
suitable, it can be merged.
74+
3. Once there is a consensus that the new feature is desirable and the design is suitable, it can be merged.
9875

9976
### How to fix a bug, or make smaller improvements
10077

@@ -103,9 +80,7 @@ requests for development.
10380

10481
### Forums
10582

106-
Questions about how to use Swift Numerics modules, or issues that are not
107-
clearly bugs can be discussed in the ["Swift Numerics" section of the Swift
108-
forums](https://forums.swift.org/c/related-projects/swift-numerics).
83+
Questions about how to use Swift Numerics modules, or issues that are not clearly bugs can be discussed in the ["Swift Numerics" section of the Swift forums](https://forums.swift.org/c/related-projects/swift-numerics).
10984

11085
## Modules
11186

@@ -121,20 +96,15 @@ forums](https://forums.swift.org/c/related-projects/swift-numerics).
12196

12297
## Notes
12398

124-
¹ Swift is currently unable to use the fully-qualified name for types when a
125-
type and module have the same name (discussion here:
126-
https://forums.swift.org/t/pitch-fully-qualified-name-syntax/28482). This would
127-
prevent users of Swift Numerics who don't need generic types from doing things,
128-
such as:
99+
¹ 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). This would prevent users of Swift Numerics who don't need generic types from doing things, such as:
129100

130101
```swift
131102
import Complex
132103
// I know I only ever want Complex<Double>, so I shouldn't need the generic parameter.
133104
typealias Complex = Complex.Complex<Double> // This doesn't work, because name lookup fails.
134105
```
135106

136-
For this reason, modules that would have this ambiguity are suffixed with
137-
`Module` within Swift Numerics:
107+
For this reason, modules that would have this ambiguity are suffixed with `Module` within Swift Numerics:
138108

139109
```swift
140110
import ComplexModule
@@ -144,9 +114,4 @@ typealias Complex = ComplexModule.Complex<Double>
144114
let a = ComplexModule.Complex<Float>
145115
```
146116

147-
The `Real` module does not contain a `Real` type, but does contain a `Real`
148-
protocol, and users may want to define their own `Real` type (and possibly
149-
re-export the `Real` module) - that why why the suffix is also applied there.
150-
New modules have to evaluate this decision carefully, but can err on the side of
151-
adding the suffix. It's expected that most users will simply `import Numerics`,
152-
so this isn't an issue for them.
117+
The `Real` module does not contain a `Real` type, but does contain a `Real` protocol, and 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. New modules have to evaluate this decision carefully, but can err on the side of adding the suffix. It's expected that most users will simply `import Numerics`, so this isn't an issue for them.

0 commit comments

Comments
 (0)