You made the same mistake :)<br>                            <br>
removeDuplTuples x:xs = nub(if ((snd x,fst x) `elem` xs) then
(removeDuplTuples xs) else ([x] ++ removeDuplTuples xs))<br><br>Should be:<br><br>
removeDuplTuples (x:xs) = nub(if ((snd x,fst x) `elem` xs) then
(removeDuplTuples xs) else ([x] ++ removeDuplTuples xs))<br><br><br>You need to put parenthesis around x:xs. <br><br>Greets,<br><br>Edgar<br><br><div class="gmail_quote">On Tue, Sep 28, 2010 at 11:57 AM, Martin Tomko <span dir="ltr">&lt;<a href="mailto:martin.tomko@geo.uzh.ch">martin.tomko@geo.uzh.ch</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  

<div bgcolor="#ffffff" text="#000000">
Hi Edgar,<br>
thanks for the help. I wanted to first test with nub, but I still
cannot get it to work. I cannot see any missing parenthesis, but I
retyped it this way to check:<div class="im"><br>
<br>
removeDuplTuples :: (Eq a) =&gt;[(a,a)] -&gt; [(a,a)]<br>
removeDuplTuples [] = []<br>
removeDuplTuples [b] = [b]<br></div>
removeDuplTuples x:xs = nub(if ((snd x,fst x) `elem` xs) then
(removeDuplTuples xs) else ([x] ++ removeDuplTuples xs))<br>
<br>
still the same error<br>
<br>
What am I missing?<br><font color="#888888">
Martin</font><div><div></div><div class="h5"><br>
<br>
On 9/28/2010 11:45 AM, edgar klerks wrote:
<blockquote type="cite">&gt;You forgot the parenthesis. Parse error in pattern
usually means a type in the input of one of your functions. Nub needs
&gt;elements that can be equal.<br>
  <br>
type has to be typo.  <br>
  <div class="gmail_quote">On Tue, Sep 28, 2010 at 11:44 AM, edgar
klerks <span dir="ltr">&lt;<a href="mailto:edgar.klerks@gmail.com" target="_blank">edgar.klerks@gmail.com</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
Martin, <br>
    <br>
You have some typos:<br>
    <br>
import Data.List<br>
removeDuplTuples :: (Eq a) =&gt; [(a,a)] -&gt; [(a,a)]
    <div><br>
removeDuplTuples [] = []<br>
removeDuplTuples [b] =
[b]                                                                                                                                    
-- using the syntactic sugar for single element in list<br>
removeDuplTuples (x:xs) = nub (if elem (snd x,fst x) xs then
removeDuplTuples xs else [x] ++ removeDuplTuples xs)<br>
    </div>
                             --------<br>
You forgot the parenthesis. Parse error in pattern usually means a type
in the input of one of your functions. Nub needs elements that can be
equal.<br>
    <br>
Nub is quitte inefficient, if your elements can be ordered, there is a
more efficient version. It is something like: <br>
    <br>
fmap head.group.sort $ [1,1,1,1,4,4,5,6,6,7,8,9]<br>
[1,4,5,6,7,8,9]<br>
    <br>
But I haven&#39;t test it thoroughly. <br>
    <br>
Greets,<br>
    <font color="#888888"><br>
Edgar                               <br>
    </font>
    <div>
    <div><br>
    <div class="gmail_quote">On Tue, Sep 28, 2010 at 11:33 AM, Martin
Tomko <span dir="ltr">&lt;<a href="mailto:martin.tomko@geo.uzh.ch" target="_blank">martin.tomko@geo.uzh.ch</a>&gt;</span>
wrote:<br>
    <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
all,<br>
I apologize for spamming this forum so frequently, but there is noone I
can turn to around here...<br>
I have a list of (a,a) tuples, and am trying something like nub, but
also matching for symmetrical tuples. I implemented it using the
template from delete from Prelude. Seems like my typse signature has
some troubles (Paarse error in pattern) but I am not sure where the
problem is.<br>
      <br>
removeDuplTuples :: [(a,a)] -&gt; [(a,a)]<br>
removeDuplTuples [] = []<br>
removeDuplTuples [b] = [b]                                            
                                                                       
                -- using the syntactic sugar for single element in list<br>
removeDuplTuples x:xs = nub (if elem (snd x,fst x) xs then
removeDuplTuples xs else [x] ++ removeDuplTuples xs)<br>
      <br>
I assume the problem lies in elem (snd x,fst x) xs but I am not sure
how to rewrite it.<br>
      <br>
Thanks for all help,<br>
Martin<br>
_______________________________________________<br>
Beginners mailing list<br>
      <a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
      <a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
    </blockquote>
    </div>
    <br>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
<br>
</div></div></div>

</blockquote></div><br>