def compose(*funcs):
    """ Composes a series of functions, like the Haskell . operator.

    Args:
        *funcs: An arbitrary number of functions to be composed.

    Returns:
        A function that accepts whatever parameters funcs[-1] does, feeds those to funcs[-1],
        feeds the result of that into funcs[-2], etc, all the way through funcs[0], and then
        returns whatever funcs[0] returned.

    >>> add1 = lambda n: n + 1
    >>> times2 = lambda n: n * 2
    >>> add3 = lambda n: n + 3
    >>> f = compose(add1, times2, add3)
    >>> f(4)
    15
    """
    def inner(*a, **kw):
        acc = funcs[-1](*a, **kw)
        for f in funcs[-2::-1]:
            acc = f(acc)
        return acc
    return inner