Consider the following map, with functions in its value:
val mapOfFunctions: Map[Symbol, T => String] = ...
I can reverse the order of the functions and the Map:
val functionOfMap: (T) => Map[Symbol, String] = (t: T) => mapOfFunctions.mapValues(f => f(t))
The question is, how to write inverse of this function. Specifically, fill out the following function:
def functionOfMapToMapOfFunction(fun: (T) => collection.Map[Symbol, String]): Map[Symbol, T => String] = {
// fill me out!
}
Side note: here I am making the assumption that the input to functionOfMapToMapOfFunction are proper ( they are convertible to MapOfFunctions )