- Proposal: SE-NNNN
- Authors: Daryle Walker, Author 2
- Review Manager: TBD
- Status: Awaiting review
This is a proposal to add a macro-like facility to automatically create lists.
This is a proposal to add a macro-like facility to automatically create lists.
// Copyright (c) 2018 Daryle Walker. | |
// Distributed under the MIT License. | |
// Based off <https://en.wikipedia.org/wiki/Calkin–Wilf_tree>. | |
// "fusc" from Edsger W. Dijkstra. | |
// To-Do: Add the iterative version of "fusc" | |
struct SternDiatomicSequenceIterator: IteratorProtocol { | |
var cache = [0: 0, 1: 1] |
/* | |
BinaryInteger+Extensions.swift | |
Created by Daryle Walker on 1/29/18. | |
Copyright (c) 2018 Daryle Walker. | |
Distributed under the MIT License. | |
Various properties and methods for BitArray's bit-twiddling. |
/// A singly-linked list. | |
public final class SinglyLinkedList<T>: RangeReplaceableCollection, MutableCollection { | |
/// A node for a singly-linked list. | |
final class Node { | |
/// The node's data. May be absent (like for sentinel nodes). | |
var value: T? | |
/// The link to the next node, or `nil` when none. | |
var next: Node! |
// | |
// LeftOpenRange.swift | |
// NodeCollections | |
// | |
// Created by Daryle Walker on 4/6/18. | |
// Copyright © 2018 Daryle Walker. All rights reserved. | |
// | |
// MARK: Primary Definitions |
// | |
// SegmentedArray.swift | |
// NodeCollections | |
// | |
// Created by Daryle Walker on 4/15/18. | |
// Copyright © 2018 Daryle Walker. All rights reserved. | |
// | |
// MARK: Globals |
// | |
// Int4.swift | |
// NegaSuperBinary | |
// | |
// Created by Daryle Walker on 6/22/18. | |
// Copyright © 2018 Daryle Walker. All rights reserved. | |
// | |
import Foundation |
/** | |
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. |
/* | |
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 { |