Trouble with custom functions

I was about to do some computation-heavy research in field of nlp and spent some time on how to construct best possible architecture. After a while of considering some practices that help to achieve best performance(or at least amortize it), I settled down with function memoization that is backed by nosql local database(mongodb in particular). But when it came to implementation in code, I stucked.

//i created a class function, which can be inherited when needed
class Function<Arguments, ReturnType>
//it was serving its purpose quite well. Like that
let summ = Function() { (a: Int, b: Int) -> Int in 
    return a + b
}
//some sugar for convenience
let answ = summ <<! (a: 1, b: 1) //type of Arguments is (Int, Int) or tuple of two integers

Then time did come to make cached version:

class CachingFunction<Arguments, ReturnType>: Function<Arguments, ReturnType>

It does still initializes and works like before, but I cannot implement memoization, since to do this I would need a Dictionary<Hashable, Value> , which is unachievable in swift at current time, because it does not have Existential types . A try with Dictionary<AnyHashable, Any> didnt succeed, since this construct erases type. My initial intuition was to inspect tuples for conforming to Hashable protocol and calculate hash value of each element, combine them and put into dictionary, but that attempt failed as well.

So my question is : How would you calculate hash of arguments that represented as tuple, or maybe i took wrong approach? Should I choose other language? Please, help.