# \`NonEmpty\` collections support

**URL:** <https://forums.swift.org/t/nonempty-collections-support/47667>\
**Category:** Discussion\
**Created:** [April 24, 2021, 8:07am UTC](https://forums.swift.org/t/nonempty-collections-support/47667 "2021-04-24T08:07:18Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jawbroken](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jawbroken](https://forums.swift.org/u/jawbroken)\
**Post date:** [April 25, 2021, 6:19pm UTC](https://forums.swift.org/t/nonempty-collections-support/47667/11 "2021-04-25T18:19:01Z")

</div>

To quote myself from the other thread:

> [@Introducing Swift Collections](https://forums.swift.org/t/introducing-swift-collections/47169/13):
>
> I wouldn't say that it is equally useful, given that many methods would require you to drop the non-empty guarantee (e.g. anything that returns a subsequence or can remove elements) and the only upside seems to be that it would remove optionality from a small number of return types (first, popFirst, randomElement, min, max). It's roughly like trying to represent a non-zero number in the type system so you can't divide by zero.

I don't find the analogy to `Optional` that compelling, because roughly all you can do with an `Optional` is conditionally unwrap it. That's why I made the analogy to a non-zero number above, i.e. you're going to want to do a lot of `Sequence/Collection` operations on a non-empty collection but be thwarted or forced to drop the non-empty guarantee.

---

_[View the full topic](https://forums.swift.org/t/nonempty-collections-support/47667)._
