Functions in Scala do not have descriptive names anymore than Ints or Lists have descriptive names; you can make a case for toString by giving a view of its value, but it will not be a name.
However, you could extend Function2 like this:
object f1 extends Function2[Int, Int, Int] { def apply(a: Int, b: Int) = a + b override def toString = "f1" }
which will act the way you want.
Or in general
class NamedFunction2[T1,T2,R](name: String, f: Function2[T1,T2,R]) extends Function2[T1,T2,R] { def apply(a: T1, b: T2): R = f.apply(a, b) override def toString = name }
then use
val f1 = new NamedFunction2[Int, Int, Int]("f1", _ + _)
and etc.
source share