Working at being lazy
As teased in the previous article, suppose you want a new kind of lazy evaluation. You want to be able to generate a lazy sequence that represents the first n values of a container.
Here’s how you could add it to LazyRandomAccess:
extension LazyRandomAccessCollection { func first_n (n: LazyRandomAccessCollection.IndexType.DistanceType) -> LazySequence< PermutationGenerator<…
View On WordPress













