I have a class, as follows:
trait Foo {
def greet(name: String) : String
}
trait Bar {
def hello(name: String) = s"Hello ${name}!"
}
class Greeter extends Foo with Bar {
def greet(name: String) = hello(name)
}
I'm curious if it is possible to implement greet
using a partial application of the hello
method? Something like:
class Greeter extends Foo with Bar {
def greet = hello
}
(Obviously this doesn't work)