[swift-evolution] Pre-proposal: CaseEnumerable protocol (derived collection of enum cases)

Alan Skipp al_skipp at icloud.com
Tue Jan 19 12:51:52 CST 2016


What do you think of the idea of enums acquiring successor() and predecessor() functions and the ability to use them in Ranges?

enum Char { case A, B, C, D, E, F }

let a = Char.A
a.successor() // Char.B

(Char.A ... Char.D) // Range Char.A -> Char.D




More information about the swift-evolution mailing list