Skip to content

Documentation fixes #60178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/public/Concurrency/TaskGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ public func withTaskGroup<ChildTaskResult, GroupResult>(
/// you can use a `for`-`await`-`in` loop:
///
/// var sum = 0
/// for await result in group {
/// for try await result in group {
/// sum += result
/// }
///
/// If you need more control or only a few results,
/// you can call `next()` directly:
///
/// guard let first = await group.next() else {
/// guard let first = try await group.next() else {
/// group.cancelAll()
/// return 0
/// }
Expand Down Expand Up @@ -578,7 +578,7 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
///
/// You can also use a `for`-`await`-`in` loop to collect results of a task group:
///
/// for await try value in group {
/// for try await value in group {
/// collected += value
/// }
///
Expand Down
4 changes: 1 addition & 3 deletions stdlib/public/core/FloatingPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
/// `infinity` is greater than this value.
static var greatestFiniteMagnitude: Self { get }

/// The [mathematical constant π][wiki], approximately equal to 3.14159.
/// The mathematical constant pi (π), approximately equal to 3.14159.
///
/// When measuring an angle in radians, π is equivalent to a half-turn.
///
Expand All @@ -339,8 +339,6 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable
///
/// print(Double.pi)
/// // Prints "3.14159265358979"
///
/// [wiki]: https://en.wikipedia.org/wiki/Pi
static var pi: Self { get }

// NOTE: Rationale for "ulp" instead of "epsilon":
Expand Down
12 changes: 9 additions & 3 deletions stdlib/public/core/FloatingPointTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def Availability(bits):

if Self == 'Float16':
SelfDocComment = '''\
/// A half-precision (16b), floating-point value type.'''

/// A half-precision (16b), floating-point value type.
///
/// `Float16` is available on Apple silicon,
/// and unavailable on Intel when targeting macOS.'''
elif Self == 'Float':
SelfDocComment = '''\
/// A single-precision, floating-point value type.'''
Expand All @@ -53,7 +55,11 @@ elif Self == 'Double':

elif Self == 'Float80':
SelfDocComment = '''\
/// An extended-precision, floating-point value type.'''
/// An extended-precision, floating-point value type.
///
/// `Float80` is available on Intel
/// when the target system supports an 80-bit long double type,
/// and unavailable on Apple silicon.'''

else:
raise ValueError('Unhandled float type.')
Expand Down
8 changes: 8 additions & 0 deletions stdlib/public/core/KeyPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ public class PartialKeyPath<Root>: AnyKeyPath { }
internal enum KeyPathKind { case readOnly, value, reference }

/// A key path from a specific root type to a specific resulting value type.
///
/// The most common way to make an instance of this type
/// is by using a key-path expression like `\SomeClass.someProperty`.
/// For more information,
/// see [Key-Path Expressions][keypath] in *[The Swift Programming Language][tspl]*.
///
/// [keypath]: https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#ID563
/// [tspl]: https://docs.swift.org/swift-book/
public class KeyPath<Root, Value>: PartialKeyPath<Root> {
@usableFromInline
internal final override class var _rootAndValueType: (
Expand Down
3 changes: 1 addition & 2 deletions stdlib/public/core/Optional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
//
//===----------------------------------------------------------------------===//

/// A type that represents either a wrapped value or `nil`, the absence of a
/// value.
/// A type that represents either a wrapped value or the absence of a value.
///
/// You use the `Optional` type whenever you use optional values, even if you
/// never type the word `Optional`. Swift's type system usually shows the
Expand Down