I’m new to Scala and trying to understand generic aspect of it. Take “curry” as an exmaple.
In Scala, the function “curry” is defined as below
def curry[A, B, C](f: (A, B) => C): A => (B => C) = a => b => f(a, b)
I wonder what is the need for the right hand side?
Because as far as I understand, this expression “curry[A, B, C](f: (A, B) => C): A=> (B => C)” is enough to logically generate this content “a => b => f(a, b)”
I mean, in the case of creation of such a level of generic, we could have a more compact syntax without having the right hand side.
Moreover, this same question I also have for other cases like “compose” also. I wish to understand more insight about these.
Please correct me if I’m wrong. Thank you so much.