title: Haskell: How to generate a cartesian product of two simple algebraic data types
body: <p>I am learning Haskell, so I'm writing some simple card games. I've defined some data types:</p>
  
  <pre><code>data Rank = Ace|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|Jack|Queen|King deriving (Eq,Show,Ord)
  
  data Suit = Hearts|Spades|Diamonds|Clubs deriving (Show)
  
  data Card = Card Rank Suit 
  </code></pre>
  
  <p>Now I'd like to create a pristine deck of 52 cards. I'm sure there is a slick way to do it, but all I can come up with is:</p>
  
  <pre><code> pristineDeck = [Card Ace Hearts, Card Two Hearts, ...]
  </code></pre>
  
  <p>Can I get Haskell to generate this list for me?</p>