apple / swift-algorithms

Commonly used sequence and collection algorithms for Swift
Apache License 2.0
5.9k stars 435 forks source link

Doc for `partitioningIndex` doesn't mention preconditions on the `self` collection. #218

Closed dabrahams closed 7 months ago

dabrahams commented 7 months ago

The original phrasing in the algorithms prototype was “The collection must already be partitioned according to the predicate, as if self.partition(by: predicate) had already been called.”

dabrahams commented 7 months ago

I'm wrong; it's there, but just buried in "Discussion." Information essential for using a function, especially preconditions, shouldn't be in “Discussion,” but if you disagree, just close this.

natecook1000 commented 7 months ago

Per documentation guidelines, the abstract of a function describes the purpose of the function. Preconditions for the target of the method or its parameters, and other information you might need, is in the discussion, parameter, or return value sections, as appropriate.

Feel free to propose revisions if you think that would make it more clear!