Sequencing Success

Further Information

Examples

Counter to Ten

Source

A simple Sequence/Collection which shows how to create a simple custom Sequence to count from 1 to 10 and then conform it to Collection, BidirectionalCollection and RandomAccessCollection

Alphabet

Source

A very simple Collection which returns all the letters of the lower-case Roman alphabet, each as a Character. This is similar to the 'Counter To Ten' example but has a different Element type to its Index to make the distinction clearer

File Structure

Source

An example of using the RecursiveSequence to perform operations on a recursive structure representing files & folers in a file system.

Messages

Source

An approximation of the messages example from the 'Meet the Swift Algorithms and Collections packages' WWDC 2021 talk.

Spirograph

Source

Using UnfoldSequence to create spirograph patterns.

Theme Park

Source

Chaining a number of sequence extension methods to find rides which people of specified heights can ride.