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# - Sort XmlNodeList with a specific Node value -

Android Java.Lang.RuntimeException : Unable to start activity Component Info -

php - htaccess subdomain and directory redirect -