[Haskell-beginners] code critique

Alexander Batischev eual.jp at gmail.com
Wed Jul 27 03:39:47 CEST 2011


Hi!

On Wed, Jul 27, 2011 at 11:19:03AM +1000, Arlen Cuss wrote:
> (Of course, this is less beautifully illustrated with 'length', because
> it doesn't actually evaluate the values ...:
> 
> > length [trace "a" 5, trace "b" 10, trace "c" 15] == 0
> False
> > 

Oh, excuse me - yes, 'length' really doesn't evaluate the values. But
still, it *builds* the list (that may be very large or even infinite),
thus slowing or even hanging your program.

-- 
Regards,
Alexander Batischev

1024D/69093C81
F870 A381 B5F5 D2A1 1B35  4D63 A1A7 1C77 6909 3C81
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110727/c753c8fe/attachment.pgp>


More information about the Beginners mailing list