I would like to eliminate the inverse function in the example below and just create an anonymous function directly in the call to bar. Can anyone suggest the correct syntax? I've tried a few variations but can't get anything to compile.
object Test {
def foo(p: Int => Boolean): Boolean = {
def inverse(p: Int => Boolean): Int => Boolean = {
e: Int => !p(e)
}
bar(inverse(p))
}
def bar(p: Int => Boolean): Boolean = true
}
bar((e:Int) => !p(e))? Edit: err, didn't read the code good enough