Return the intermediate values of a reduction

    :param fn: a function
    :param seq: a sequence
    :param acc: the accumulator
    :returns: a list

    >>> reductions(lambda x, y: x + y, [1, 2, 3])
    [1, 3, 6]

    >>> reductions(lambda x, y: x + y, [1, 2, 3], 10)
    [11, 13, 16]

def reductions(fn, seq, acc=None):
    """Return the intermediate values of a reduction

    :param fn: a function
    :param seq: a sequence
    :param acc: the accumulator
    :returns: a list

    >>> reductions(lambda x, y: x + y, [1, 2, 3])
    [1, 3, 6]

    >>> reductions(lambda x, y: x + y, [1, 2, 3], 10)
    [11, 13, 16]

    """
    indexes = xrange(len(seq))
    if acc:
        return map(lambda i: reduce(lambda x, y: fn(x, y), seq[:i+1], acc), indexes)
    else:
        return map(lambda i: reduce(lambda x, y: fn(x, y), seq[:i+1]), indexes)