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

davesweeris at mac.com davesweeris at mac.com
Tue Jan 19 21:37:09 CST 2016

I am NOT saying “here’s the answer”, but I put something up on my github that does some of this: https://github.com/TheOtherDave/EnumEnhancer

Again, not saying that’s how we should do it or anything, but if anyone thinks it’d be useful until the “official” enhancements come out, help yourself. There’ll still be boilerplate, but it makes some attempt to keep things correct.

- Dave Sweeris

> On Jan 17, 2016, at 15:44, Jacob Bandes-Storch via swift-evolution <swift-evolution at swift.org> wrote:
> Hi folks,
> I've drafted a proposal to add a CaseEnumerable protocol, which will derive a static variable "cases" for enum types. Feedback is welcome, especially for refining the proposal before I submit a formal PR.
> The draft is here; full text below. https://github.com/jtbandes/swift-evolution/blob/977a9923fd551491623b6bfd398d5859488fe1ae/proposals/0000-derived-collection-of-enum-cases.md <https://github.com/jtbandes/swift-evolution/blob/977a9923fd551491623b6bfd398d5859488fe1ae/proposals/0000-derived-collection-of-enum-cases.md>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160119/40ca6c53/attachment.html>

More information about the swift-evolution mailing list