10 karma · joined Dec 24, 2012 (13y ago) · 10 submissions
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
http://www.robotc.net/blog/2012/10/24/robotc-3-5-global-vs-l...
comment 13y ago · link · parent
Defining any' as
any' f xs = foldl (\acc x -> f x || acc) False xs
Then trying to evaluate any' even [1..] runs forever, but if we modify it slightly to use foldr instead as
any' f xs = foldr (\x acc -> f x || acc) False xs
Then evaluating any' even [1..] terminates basically immediately with True.