Pass function to another function in Scala, get "Missing parameter type for expanded function Scala"
I wrote the following test: "List" should "be [3, 4] for condition ‘_ <= 2’" in { val l: List[Int] = List(1, 2, 3, 4) assertResult(List(3, 4))(dropWhile(l, _ <= 2)) } For function: def dropWhile[A](l: List[A], f: A => Boolean): List[A] = l match { case Nil => List() case Cons(h, t) => if (f(h))… Read More Pass function to another function in Scala, get "Missing parameter type for expanded function Scala"