- Proposal: SE-NNNN
- Authors: Daryle Walker
- Review Manager: TBD
- Status: Awaiting implementation
During the review process, add the following fields as needed:
- Implementation: apple/swift#NNNNN
| // | |
| // StridingSequence.swift | |
| // CLITest | |
| // | |
| // Created by Daryle Walker on 1/31/19. | |
| // Copyright © 2019 Daryle Walker. All rights reserved. | |
| // | |
| // WARNING: I think this requires Swift 5, since it needs Sequence to no longer have an SubSequence member. |
| // BasicSetSubtraction.swift by Daryle Walker | |
| /// An iterator that vends elements from a sorted wrapped iterator, subtracting the elements from in another wrapped sorted filter iterator. | |
| public struct SetSubtractionIterator<Base: IteratorProtocol, Filter: IteratorProtocol> where Base.Element == Filter.Element, Base.Element: Comparable { | |
| /// The iterator where the vended elements come from. | |
| var base: Base | |
| /// The iterator where matches to be filtered come from. | |
| var filters: Filter |
| // RotateSwapMove.swift by Daryle Walker | |
| extension MutableCollection { | |
| /** | |
| Rotates the elements such that the value at the given index is now at `startIndex`. | |
| Passing `startIndex` as `i` has no effect. | |
| The method applies a left-rotation, bringing the target element's value to `startIndex`. |
| // ForEachIndex.swift by Daryle Walker | |
| extension Collection { | |
| /** | |
| Calls the given closure on each element index in the collection in the | |
| same order as a `for`-`in` loop. | |
| The two loops in the following example produce the same output: |
During the review process, add the following fields as needed:
This manifesto is for collecting the ideas needed to introduce the classic fixed-size array family of types to Swift.
| // | |
| // BinarySearch.swift | |
| // SortedSet | |
| // | |
| // Created by Daryle Walker on 8/22/19. | |
| // Copyright © 2019 Daryle Walker. All rights reserved. | |
| // | |
| extension Collection { |
| // | |
| // IntegerNull.swift | |
| // ZeroInteger | |
| // | |
| // Created by Daryle Walker on 8/27/19. | |
| // Copyright © 2019 Daryle Walker. All rights reserved. | |
| // | |
| // MARK: Zero-bit Integer Primary Definitions |
| extension Collection { | |
| /// Computes the binary-tree children indices for the given starting index, | |
| /// if the collection is long enough. | |
| /// | |
| /// Child elements of a flattened tree are consecutive, so if two indices | |
| /// are returned, `distance(from: left!, to: right!) == 1`. | |
| /// | |
| /// - Parameter source: The index of the parent element. | |
| /// - Returns: A tuple with the indices of the left and right binary-tree |
| // MARK: Per-Element Sharing in Merged Sorted Sequences | |
| /// Primary source categories when merging two sets together. | |
| public enum MergedSetElementSource<Element> { | |
| /// The given element is only in the first set. | |
| case exclusivelyFirst(Element) | |
| /// The element is in both sets. Both versions are given. | |
| case shared(Element, Element) | |
| /// The given element is only in the second set. |