title: All given items have the property
body: <p>A card has a type and a color:</p>
  
  <pre><code>data CardType = Spades | Clubs | Diamonds | Hearts
  
  data CardColor = Black | Red
  
  cardColor :: CardType -&gt; CardColor
  
  cardColor card =
    case card of Spades -&gt; Black
                 Clubs -&gt; Black
                 Diamonds -&gt; Red
                 Hearts -&gt; Red
  
  type Card = (CardType, CardColor)
  </code></pre>
  
  <p>I want to check whether all the cards have the same color:</p>
  
  <pre><code>allTheSameColor :: [Card] -&gt; Bool
  
  allTheSameColor cardList = ???
  </code></pre>
  
  <p>I wonder, how would I do that <strong>without</strong> using any library function such as <code>filter</code>? But it's allowed to re-implement it yourself since I want to be able to understand at a deep, functional level how to solve this problem.</p>