title: Haskell Filter (3-tuple) list with the list itself
body: <p>I'm still new to Haskell and am trying some things. I've got a list full of Pythagorean triples. Now I want to remove all identical triples. For example (6,8,10) is in a way identical to (3,4,5). So I wrote a function which checks whether two 3-tuples are identical or not, if it's identical it returns <code>True</code>, if not <code>False</code>. But now I have a list of 3-tuples (among which are identical triplets) and I want to filter out all the identical (3-tuples). I've been searching for identical problems on StackOverflow, but sadly couldn't find anything that I could use. </p>
  
  <p>My current code is below. (Don't mind efficiency, because I'm sure I'm doing it very inefficient at the moment.)</p>
  
  <p>Generating the list of triples:</p>
  
  <pre><code>pyth :: Int -&gt; [(Int, Int, Int)]
  pyth i = [(a, b, c) | a &lt;- [1..i], b &lt;- [1..a], c &lt;- [1..i], (a^2) + (b^2) == (c^2)]
  </code></pre>
  
  <p>Some functions to help work with 3-tuples:</p>
  
  <pre><code>first :: (Int, Int, Int) -&gt; Int
  first (a,_,_) = a
  
  second :: (Int, Int, Int) -&gt; Int
  second (_,a,_) = a
  
  third :: (Int, Int, Int) -&gt; Int
  third (_,_,a) = a
  </code></pre>
  
  <p>The function which checks if two triples are identical or not:</p>
  
  <pre><code>    doubleCheck :: (Int, Int, Int) -&gt; (Int, Int, Int) -&gt; Bool
      doubleCheck a b
       | (((first b) `div` (first a)) == ((second b) `div` (second a))) &amp;&amp;
        ((first b) `mod` (first a) == 0) &amp;&amp; 
        ((second b) `mod` (second a) == 0) = True
       |  otherwise = False
  </code></pre>
  
  <p>Now with the things I heard and read about Haskell and the power of higher order functions I suppose the solution would be like two lines of code or something. But I'm stuck with this for like a day and can't figure out how to solve this problem.</p>
  
  <p>Thanks in advance!</p>