- 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
During the review process, add the following fields as needed:
// 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: |
// 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`. |
// 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 |
// | |
// 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. |
/* | |
MultipleSearch.swift -- Sequence and collection multi-element search, all locations | |
Copyright (c) 2019 Daryle Walker | |
*/ | |
// MARK: Searching for every occurance of a string of elements within a sequence | |
extension Sequence { |
/** | |
A lazy wrapper for `Collection.split`, but only when empty subsequences can also be vended. | |
Based off the `LazySplitCollection` sample type in the [article "Conditional Conformance in the Standard Library" at the Swift Blog](https://swift.org/blog/conditional-conformance/) by [Ben Cohen](https://twitter.com/airspeedswift/), but extended only to support maximum subsequence counts. | |
*/ | |
public struct LazyEmptyAdmittingSplitCollection<Base: Collection> { | |
/// The wrapped collection, whose subsequences will be vended as elements of `self`. | |
let base: Base | |
/// The maximum number of splits allowed; the count of subsequences vended is at most one greater than this. |
// | |
// Int4.swift | |
// NegaSuperBinary | |
// | |
// Created by Daryle Walker on 6/22/18. | |
// Copyright © 2018 Daryle Walker. All rights reserved. | |
// | |
import Foundation |
// | |
// SegmentedArray.swift | |
// NodeCollections | |
// | |
// Created by Daryle Walker on 4/15/18. | |
// Copyright © 2018 Daryle Walker. All rights reserved. | |
// | |
// MARK: Globals |