You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
Breaking Changes
The pattern API has been rearranged to improve performance. The compiler can now do a much better job of specialization.
The Pattern base class has been removed and its subclasses converted to structures.
In its place, PatternProtocol has been shortened to simply Pattern.
LiteralPattern is no longer needed. Any SearchableCollection can be used directly.
Several pattern types have been renamed:
CompositePattern → ConcatenatedPatterns
NotPattern → NegatedPattern
CompositePattern and AlternativePatterns have each been split into several layers that make different tradeoffs between performance and composability.
ConcatenatedPatterns and AlternativePatterns represent heterogeneous pairs of patterns.
Pros:
These are fast, because the compiler can specialize them.
They can be composed at compile time to any level of complexity by stringing them together with + and ∨.
Cons:
Composed types are heavily generic and make unwieldy properties, parameters or return types.
Composition cannot be done iteratively, since each addition changes the type.
NaryConcatenatedPatterns and NaryAlternativePatterns represent n‐ary homogeneous collections of patterns.
Pros:
These are fast, because the compiler can specialize them.
They can be composed iteratively by constructing an array to pass to the initializer.
Cons:
All components must be of the same type.
AnyPattern can be used to convert various patterns to the same type for use withNaryConcatenatedPatterns and NaryAlternativePatterns.
Pros:
Infinite composability.
Cons:
Not nearly as fast.
difference(from:) has been renamed to groupedDifferences(from:) to distinguish it from the similar method now available in the Standard Library on some platforms.
String index conversions now reflect the fact that the various views’ indices are merely type aliases of one another. Due to the absence of type safety, return values can now be nil if any index can lack a corresponding value, even those indices the type label does not intend. scalar(in:) can be used to get an unoptional scalar index. It rounds down when called on sub‐scalar indices by accident.
New Features
A new module, SDGVersioning, provides utilities for working with semantic versions. (It was formerly a part of the SDGSwift package.)
Several types can now be used as property wrappers:
Shared (indirectly via @SharedProperty). The projected value is the Shared reference.