
22 Jun
2007
22 Jun
'07
3:43 p.m.
On Fri, Jun 22, 2007 at 11:31:17PM +0800, Michael T. Richter wrote:
1. Using foldr means I'll be traversing the whole list no matter what. This implies (perhaps for a good reason) that it can only work on a finite list.
foldr is lazy.
Please tell me I'm wrong and that I'm missing something?
You are wrong and you're missing something :) compare: any ((==) 2) [1,2,3] and any ((==) 2) [1..] any ((==) 0) [1..] will go _|_ of course. Phil -- http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt