basic haskell How to check if a list of Booleans contains a value? -


how check if list of booleans contains true?

eg

[true,false] = true [false,false]=false [false,false,true] = true 

you can check existence of standard functions in hoogle -

for e.g. -

http://www.haskell.org/hoogle/?hoogle=%5bbool%5d+-%3e+bool

gives several functions, out of "or" 1 requirement.

edit:

or function. it's signature, or :: [bool] -> bool - means takes in list of bool , returns bool.

so, doing

mylist = [true, false, false]  if (or mylist) ..something.. else ..something else..  

might how use in code (replace ..something.. , ..something else.. actual expressions)


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -