[Haskell-cafe] list comprehansion performance has hug different

Junior White efiish at gmail.com
Tue Jan 29 10:40:08 CET 2013


Hi Artyom,
   Thanks! But I don't understand why in the first case "queens' (k-1)" is
being recomputed n times?


On Tue, Jan 29, 2013 at 5:31 PM, Artyom Kazak <artyom.kazak at gmail.com>wrote:

> Junior White <efiish at gmail.com> писал(а) в своём письме Tue, 29 Jan 2013
> 12:25:49 +0300:
>
>
>  The only different in the two program is in the first is "q <- [1..n], qs
>> <- queens' (k-1)," and the second is "qs <- queens' (k-1), q <- [1..n]".
>>
>
> In the first case `queens' (k-1)` is being recomputed for every q (that
> is, n times). Of course it would matter :)
>
> ______________________________**_________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/**mailman/listinfo/haskell-cafe<http://www.haskell.org/mailman/listinfo/haskell-cafe>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130129/2b5dadb0/attachment.htm>


More information about the Haskell-Cafe mailing list