On Sun, Oct 28, 2007 at 11:26:46AM -0400, Prabhakar Ragde wrote:
> Jerzy Karczmarczuk wrote:
>
>> Just a trivial comment... 1. Don't speak about comparing *languages* when 
>> you compare *algorithms*,
>>   and in particular data structures.
>> 2. Please, DO code the above in C, using linked lists. Compare then. 3. 
>> Check the influence of bare printing, separated from the computation.
>
> Isn't GHC clever enough to optimize away the entire computation if there is 
> no I/O?

Yes, but GHC is not clever enough to solve the perfect number
classification problem.  'length' will suffice, and is prefered for most
enumeration benchmarks.

Note, however, that there are a grand total of 4 perfect numbers less
than 10,000.  Not exactly an IO problem.

Stefan

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to