title: intersect function in Haskell
body: <p>i did this function for intersect in haskell and it just doesnt work. i know that the aux works but the main one no. Help pleas</p>
  
  <pre><code>myintersect ::  Eq a =&gt; [a] -&gt; [a] -&gt; [a]
  myintersect a [] = a
  myintersect l (h1:t1) = (myintersect (intersectaux h1 l) t1)
  
  intersectaux :: Eq a =&gt; a -&gt; [a] -&gt; [a]
  intersectaux _ [] = []
  intersectaux a (h:t) = if a==h then h:intersectaux a t else intersectaux a t
  </code></pre>