def reduceWith(reducer, seed, iterable):
    """
    reduceWith takes reducer as first argument, computes a reduction over iterable.
    Think foldl from Haskell.
    reducer is (b -> a -> b)
    Seed is b
    iterable is [a]
    reduceWith is (b -> a -> b) -> b -> [a] -> b
    """
    accumulation = seed
    for value in iterable:
        accumulation = reducer(accumulation, value)
    return accumulation