Tutorial by Examples

NOTE: This is only available in Scala 2.12+ (and in recent 2.11.x versions with the -Xexperimental -Xfuture compiler flags) A SAM type can be implemented using a lambda: 2.11.8 trait Runnable { def run(): Unit } val t: Runnable = () => println("foo") The type can optional...

Page 1 of 1