The accumulator tail recursion transform claims to work for any associative