[Haskell-cafe] How to improve its performance ?
Ozgur Akgun
ozgurakgun at gmail.com
Thu Mar 18 07:44:32 EDT 2010
As Daniel pointed out earlier, this may be of a little bit of help:
http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/src/Data-List.html#subsequences
On 18 March 2010 04:03, Alexander Solla <ajs at 2piix.com> wrote:
>
> On Mar 17, 2010, at 8:33 PM, zaxis wrote:
>
>
>> `allPairs list = [(x,y) | x <- list, y <- list] ` is not what
>> `combination`
>> does !
>>
>>> let allPairs list = [(x,y) | x <- list, y <- list]
>>> allPairs [1,2,3]
>>>
>> [(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)]
>>
>
> 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 "two groups".
> You don'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.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
--
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100318/88453a1a/attachment.html
More information about the Haskell-Cafe
mailing list