title: Check and see if all elements of a list match a parameter
body: <p>I want to make a function that checks to see if each row of the board for the  <a href="http://mathcs.pugetsound.edu/~tmullen/pages/bertspel/" rel="nofollow noreferrer">Bert Bos puzzle</a> is red one row at a time, but conceptually I'm having a hard time with this. Initially I make the board with all blue squares, but once the squares have been flipped with a flip function, the allRed function should be able to tell if the row is all red or not.  Each row is represented by a list of colors, either Blue or Red</p>
  
  <p>I know I should be using the <code>all</code> function, but I'm having some problems actually writing it out for my situation</p>
  
  <p>Here is what I have so far: </p>
  
  <pre><code>generateboard :: Int -&gt; [[Color]]
  generateboard n = replicate n (replicate n Blue)
  
  
  allRed :: [[Color]] -&gt; Bool
  let board = generateboard
  allRed board = []
  allRed board = all ([x:_ | x &lt;- board, x == Red]) 
    allRed board 
  </code></pre>