[Haskell-cafe] Shouldnt this be lazy too?

Miguel Mitrofanov miguelimo38 at yandex.ru
Mon Sep 24 13:13:28 EDT 2007


>> length [1..] > 10
>
> isnt lazily evaluated! I wouldnt expect this to be a bug, but
> in this case, shouldnt the computation end when the length function
> evaluation goes something like:

No. You want GHC to deduce that length would only increase in future.  
This property is relatively complex and GHC isn't so smart. Moreover,  
this property isn't even true: for example, if numeric overflow  
occurs. More importantly, this property doesn't make sense: length  
[1..] is (_|_) - undefined value, so this inequality is also  
meaningless.


More information about the Haskell-Cafe mailing list