from functools import reduce


def mappend(func, *args, **kargs):
    """Like map but assume func returns a list. Returned lists are merged into
    a single one.
    """
    return reduce(lambda a,b: a+b, map(func, *args, **kargs), [])