function version of filter, when `x` is a Functor of Monoid, it will call:
    `reduce(lambda e: e.extend, x.fmap(f))`

def filter_(f, x):
    """
    function version of filter, when `x` is a Functor of Monoid, it will call:
    `reduce(lambda e: e.extend, x.fmap(f))`
    """
    return reduce(lambda e, v: e.extend(v), x.fmap(f))