Merge dictionaries. Later keys overwrite.

    .. code-block:: python

        merged(dict(a=1), dict(b=2), c=3, d=1)

def merged(*dicts, **kwargs):
    """
    Merge dictionaries. Later keys overwrite.

    .. code-block:: python

        merged(dict(a=1), dict(b=2), c=3, d=1)

    """
    if not dicts:
        return Struct()
    result = dict()
    for d in dicts:
        result.update(d)
    result.update(kwargs)
    struct_type = type(dicts[0])
    return struct_type(**result)