Simple syntax for treating a instance method as a function

65 Views Asked by At

In Java, we can do something like this:

ObservableStringValue str = ...;
Binding<Integer> strLen = EasyBind.map(str, String::length);

Where String::length effectively is an instance method being used as a function. Is there an equivalent form in Scala? (And by extension, an equivalent way to use EasyBind in Scala)

1

There are 1 best solutions below

0
On
scala> "dsfs".toString _
res1: () => String = <function0>