[swift-evolution] [Fake-Proposal] Remove enums with associated objects

Tino Heth 2th at gmx.de
Mon Feb 20 14:07:33 CST 2017

Obviously, this won't become an accepted proposal -  neither the time nor the author would be appropriate for such a result.
But the list seems a little bit bored lately, so maybe a relaxed discussion without practical implications isn't the worst thing to have now ;-)

Several current threads seem to cry for sum types, so imho it is a valid question what's wrong with them, and why Swift prefers enums instead.

I'm sure such a debate already happened, but I haven't seen its arguments... and the ones that come to my mind don't fit to reality:
Enums might be more powerful, but imho Optional<Optional<T>> feels more like a burden.
Sum types, on the other hand, can be composed on the fly and could save us from several, incompatible implementations of trivial things like Result or JSONValue.

So, what is the big advantage of enums?

More information about the swift-evolution mailing list