def foreach(data):
    """A foreach function to make map() look a little nicer.
    
    Example:
        >>> list(foreach([1, 2, 4])(lambda n: n * 2))
        [2, 4, 3]
    """

    def wrapped(func):
        return map(func, data)

    return wrapped