def first(xs, fn=lambda _: True, default=None):
    """Return the first element from iterable that satisfies predicate `fn`,
    or `default` if no such element exists.

    Args:
        xs (Iterable[Any]): collection
        fn (Callable[[Any],bool]): predicate
        default (Any): default

    Returns:
        Any

    """
    return next((i for i in xs if fn(i)), default)