Suppose this very simple example:
def complexMethod (first : Int, second : Int) : Boolean = {
//heavy stuff goes in here
true
}
val myList : List[Int] = List(1,2,3)
val newList : List[Int] = myList.filter(_ => {complexMethod(_, 2)})
Im getting a message that says "Type mismatch, expected: Int => Boolean, actual: Int => Int => Boolean"
How is that up above not Int => Boolean ??
Basically I want to send the item to a function where it will perform some logic and return a boolean. What is the proper way to do it and respect the "Int => Boolean" ?
Thank you