from typing import Collection
from typing import Callable


def exists(s: "Collection"):
    """
    Returns a function, which takes a predicate `p` as argument and which returns
    True of there exists an element `e` in `s` for which `p(e)` is True.
    :param s: a collection (set, list, ...) of elements.
    :return: Function that takes predicate `p` as argument and returns True of `p`
    holds for some element of `s`.
    """
    def check(p: Callable[[object], bool]) -> bool:
        for e in s:
            if p(e):
                return True
        return False
    return check