Exemple #1
0
 /**
  * This method returns a pair of linked lists: those items that satisfy the predicate and
  * those items that do not satisfy the predicate.
  *
  * @access public
  * @static
  * @param ILinkedList\Type $xs                              the linked list to be partitioned
  * @param callable $predicate                               the predicate function to be used
  * @return ITuple\Type                                      the results
  */
 public static function partition(ILinkedList\Type $xs, callable $predicate) : ITuple\Type
 {
     return ITuple\Type::box2(ILinkedList\Module::filter($xs, $predicate), ILinkedList\Module::reject($xs, $predicate));
 }