<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
I don't think is possible because the filter you are willing to apply is valid only after you have all the occurences in the resulting list.<br><br>Vincenzo<br><br><div>> From: joelr1@gmail.com<br>> Date: Tue, 16 Aug 2011 15:27:43 +0100<br>> To: erlang-questions@erlang.org<br>> Subject: Re: [erlang-questions] omaha poker hand permutations<br>> <br>> The problem can be reduced to the following:<br>> <br>> 5> L3 = ["AD", "AH", "AS", "QS"].<br>> ["AD","AH","AS","QS"]<br>> <br>> 6> L4 = [ {A, B} || A <- L3, B <- L3, A /= B].                            <br>> [{"AD","AH"},<br>>  {"AD","AS"},<br>>  {"AD","QS"},<br>>  {"AH","AD"},<br>>  {"AH","AS"},<br>>  {"AH","QS"},<br>>  {"AS","AD"},<br>>  {"AS","AH"},<br>>  {"AS","QS"},<br>>  {"QS","AD"},<br>>  {"QS","AH"},<br>>  {"QS","AS"}]<br>> <br>> Note the duplicate pairs of AD, AH and AH, AD.<br>> <br>> Can these be eliminated inside the list comprehension itself?<br>> <br>>   Thanks, Joel<br>> <br>> --------------------------------------------------------------------------<br>> - for hire: mac osx device driver ninja, kernel extensions and usb drivers<br>> ---------------------+------------+---------------------------------------<br>> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont<br>> ---------------------+------------+---------------------------------------<br>> <br>> <br>> <br>> _______________________________________________<br>> erlang-questions mailing list<br>> erlang-questions@erlang.org<br>> http://erlang.org/mailman/listinfo/erlang-questions<br></div>                                         </div></body>
</html>