[swift-users] Crossing Sequence/Collection line for lazy operations
Daryle Walker
darylew at mac.com
Thu Jan 4 19:36:45 CST 2018
The docs for LazySequenceProtocol says to create lazy sequence operations, extend the protocol with methods that return lazy wrappers that conform to LazySequenceProtocol. The analogue for LazyCollectionProtocol just replaces all the “sequences” with “collections.” But I have written a Sequence that is based off a Collection. So the type conforms to LazySequenceProtocol but its “lazy” generator is an extension method of LazyCollectionProtocol. Is that OK; there’s no library assumptions I’m breaking?
(The type is a single-pass vendor of fixed-size sub-collections.)
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20180104/f9f48408/attachment.html>
More information about the swift-users
mailing list