🎁 A compile-time guarantee that a collection contains a value.
ExpressibleByArrayLiteral
and ExpressibleByDictionaryLiteral
(thanks @fwcd, https://github.com/pointfreeco/swift-nonempty/pull/49).Sendable
(thanks @tgrapperon, https://github.com/pointfreeco/swift-nonempty/pull/52).Full Changelog: https://github.com/pointfreeco/swift-nonempty/compare/0.4.0...0.5.0
NonEmpty
now manages its own synthesized iterator in order to avoid potential stack overflows when calling to APIs on the iterator of the collection it wraps.NonEmpty
no longer conditionally conforms to StringProtocol
. Apple documents against this conformance, and though engineers say there should be no issue with doing so, ABI-wise, we encountered a compiler crash when fixing the bug in the previous bullet point.+
operator between two NonEmpty
s was ambiguous (thanks @buscarini).NonEmpty
now wraps a base collection rather than a single element and collection as separate fields. This improves the performance and reliability of working with NonEmpty
collections. This does unfortunately mean that invariants can compile and make their way into the system at run time, but we do our best to ensure they cannot be constructed.NonEmpty
to swift-nonempty
(thanks @maximkrouk).This release brings Swift 5 support, including an optimization around the mutation of non-empty collections!
Swift 4.2 on Linux has a regression that prevents NonEmpty
from conditionally conforming to RandomAccessCollection
. We're temporarily removing support for the sake of compatibility.
This release updates NonEmpty to be compatible with Swift 4.2's randomness APIs.
This preliminary release has the basic NonEmpty
type implemented with a few starting conformances to common Swift protocols.