itertools-ts icon indicating copy to clipboard operation
itertools-ts copied to clipboard

Implement summary.isPartitioned()

Open Smoren opened this issue 1 year ago • 0 comments

Returns true if all elements of given collection that satisfy the predicate appear before all elements that don't.

  • Returns true for empty collection or for collection with single item.
  • Default predicate if not provided is the boolean value of each data item.
function *isPartitioned<T>(...iterable: Iterable<T> | Iterator<T>, predicate?: (datum: T) => boolean): boolean

PHP implementation example

Needs to be implemented:

  • summary.isPartitioned()
  • summary.isPartitionedAsync()
  • Stream.isPartitioned()
  • AsyncStream.isPartitioned()

Smoren avatar Feb 09 '25 12:02 Smoren