title: Haskell Type error in application
body: <p>i keep getting type error in application in this line : filter1 (k) (y:ys) = if occursIn (headof (y:ys))(k) then filter1 k (ys) else filter1 k1 (ys) where k1 = k:y 
  any help please , 
  thanks in advance </p>
  
  <pre><code>occursIn (x) [] = False
  
  occursIn x (x1:xs) = if (x == x1) then True else occursIn x (xs)
  
  headof [] = error "empty list"
  
  headof (x:xs) = x
  
  filter1 (k) [] = k
  
  filter1 (k) (y:ys) = if occursIn (headof (y:ys))(k) then filter1 k (ys) else filter1 k1 (ys) where k1 = k:y
  
  
  filter [] = []
  filter (x:xs) = if xs == [] then x else filter1 [] (x:xs)
  </code></pre>