I have the following code, which is supposed to search through an array and see if the anything matches the second argument.
def any(check: Set[Any], expr: Boolean): Boolean = {
var checked = check.filter(_ => expr)
if (checked == Set())
return false
else
return true
}
It is supposed to be called like this:
any(Set(3, 4, 5, 6), _ > 5)
But when I call it:
error: missing parameter type for expanded function ((x$1) => x$1.$greater(5))
I have very little experience with functional languages, and Scala, so, please give me a thorough explanation of what is going on and how to fix it!