As Daniel pointed out earlier, this may be of a little bit of help:<br><br><a href="http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/src/Data-List.html#subsequences">http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/src/Data-List.html#subsequences</a><br>
<br><br><br><div class="gmail_quote">On 18 March 2010 04:03, Alexander Solla <span dir="ltr">&lt;<a href="mailto:ajs@2piix.com">ajs@2piix.com</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 class="im"><br>
On Mar 17, 2010, at 8:33 PM, zaxis wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
`allPairs list = [(x,y) | x &lt;- list, y &lt;- list]  ` is not what `combination`<br>
does !<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
let allPairs list = [(x,y) | x &lt;- list, y &lt;- list]<br>
allPairs [1,2,3]<br>
</blockquote>
[(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)]<br>
</blockquote>
<br></div>
Yeah, I know that.  I said so specifically.  combination computes the power set of a list.  You said your goal was to compute a set of &quot;two groups&quot;.  You don&#39;t need the power set in order to compute a set of pairs.  Moreover, computing the power set is a slow operation.  Indeed, it is the source of your slowness.<div>
<div></div><div class="h5"><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>