scala - Applying logical and to list of boolean values -


consider following list of boolean values in scala

list(true, false, false, true) 

how using either foldright or foldleft emulate function of performing logical , on of values within list?

val l = list(true, false, false, true) val andall = l.foldleft(true)(_ && _) 

Comments

Popular posts from this blog

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

c# - Sort XmlNodeList with a specific Node value -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -