>>> from Redy.Collections import Traversal, Flow
    >>> def even(a: int) -> bool: return a % 2 == 0
    >>> lst: Iterable[int] = [1, 2, 3]
    >>> x = Flow(lst)[Traversal.filter_by(even)].unbox
    >>> assert list(x) == [2]

def filter_by(fn: Callable[[T], bool]) -> Callable[[ActualIterable[T]], Iterable[T]]:
    """
    >>> from Redy.Collections import Traversal, Flow
    >>> def even(a: int) -> bool: return a % 2 == 0
    >>> lst: Iterable[int] = [1, 2, 3]
    >>> x = Flow(lst)[Traversal.filter_by(even)].unbox
    >>> assert list(x) == [2]
    """
    return lambda collection: builtins.filter(fn, collection)