I tried Google search and could not find a decent forall example. What does it do? Why does it take a boolean function?
forall
Please point me to a reference (exce
Scala's forall is also a great tool to do something like applying logical and to a list of boolean values with the early exist:
val evalResults: List[Boolean] = List(evaluateFunc1(), evaluateFunc2(), evaluateFunc3(), evaluateFunc4(), evaluateFunc5()) evalResults.forall(result => result == true)