title: How to Search through a list of Integers in Haskell
body: <p>Okay so I'm extremely new to Haskell, and i know there's a lot of info on this stuff but i just don't understand it. If someone could help explain and show me what I'm doing wrong that would be greatly appreciated,</p>
  
  <p>here's some of the code:</p>
  
  <pre><code>n = 8                     -- number of ingredients (excluding cream)
  
  type Recipe = [Integer]   -- some ingredients
  
  -- list all recipes with k of n ingredients
  
  choose :: Integer -&gt; Integer -&gt; [Recipe]
  choose n k
    | k == 0    = [[]]      -- only recipe with no ingredients
  
    | n == k    = [[1..n]]  -- only recipe with all ingredients
  
    | otherwise = choose (n-1) k ++ map (++ [n])(reverse (choose (n-1) (k-1)))
  
  -- omlette legality (rules must hold conjunctively)
  
  legal r = head $ map (\rule -&gt; False) ruleset
  
  ruleset = [rule0, rule1, rule2, rule3, rule4, rule5, rule6, rule7]
  
  
  -- Rule 0: If truffles, then precisely truffles.
  rule0 r = False
  
  -- Rule 1: Either truffles, garlic, cream, or precisely one meat.
  rule1 r = False 
  
  
  -- Rule 2: Not both peppers and onions.
  rule2 r = False 
  </code></pre>
  
  <p>and Here are the ingredients</p>
  
  <pre><code>bacon     = elem 1
  peppers   = elem 2
  ham       = elem 3
  mushrooms = elem 4
  sausage   = elem 5
  onions    = elem 6
  garlic    = elem 7
  truffles  = elem 8
  cream     = elem 9
  </code></pre>
  
  <p>Now I'm trying to change the Rules to make them meet the commented out requirements, essentially searching through the list of ingredients,
  I've tried something along the lines of</p>
  
  <pre><code>r = if any ( 5== ) Recipe
  </code></pre>
  
  <p>but obviously it's not working, could someone elaborate on what I'm doing wrong</p>