def dct_reduce(reduce_fn, dcts):
    """Similar to `reduce`, but applies reduce_fn to fields of dicts with the
    same name.

    >>> dct_reduce(sum, [{"a": 1}, {"a": 2}])
    {'a': 3}
    """
    keys = dcts[0].keys()

    return {key: reduce_fn([item[key] for item in dcts]) for key in keys}