class Map(dict):

    def __init__(self, **xw):
        super(Map, self).__init__(**xw)
self.__dict__ = self

def Left(x):
    return Map(fold=lambda f, g: f(x), bimap=lambda f, g: Left(f(x)))

def Right(x):
    return Map(fold=lambda f, g: g(x), bimap=lambda f, g: Right(g(x)))
How do I decorate a partially applied function in Python 3?