def left_associative(func):
    """
    Decorator: convert a binary function to a left associative n-ary function.

    Example:
        left_associative(f)(x, y, z) is equivalent to f(f(x, y), z)
    """
    def la_func(x, *args):
        return x if not args else func(la_func(x, *args[:-1]), args[-1])
    return la_func