I am trying to create a function that receives a basic curried adder function with 2 parameters and returns uncurried adder function, and vice versa for the currying function(receives uncurried-returns curried) in scala. I am having a hard time figuring the return types of curried functions , can anyone help out?
def adderCurried(a: Int)(b: Int): Int = a + b //define a function that returns uncurried version of this function: val adderUncurried = toAdderUncurried(adderCurried) adderUncurried(5,6) // returns 11 def adder(a: Int, b: Int): Int = a + b //define a function that returns curried version of this function: val adderCurried = toAdderCurried(adder) adderCurried(5,6) // returns 11