Suppose and . If w.r.t. comp then will occur before in the resulting list. If then f is a candidate for the new list. If the candidate does not satisfy the predicate cancel it is inserted into the resulting list, otherwise it is canceled and the next elements are tested.