def remove(pred):
    """Remove any item from collection on traversal if that item meets condition
    specified in pred."""
    def generator(coll):
        for item in coll:
            if not pred(item):
                yield item
    return generator