18/10/03 13:41:50.63 OGYXL17c.net
elem_r y ys = foldr (\x acc -> if x==y then True else acc) False ys
elem_r 7 [1..]
elem_r 0 [1..]
Prelude> elem_r 7 [1..]
True
の内部動作は理解しがたい。
URLリンク(learnyouahaskell.com)
One big difference is that right folds work on infinite lists, whereas left ones don't!
To put it plainly, if you take an infinite list at some point and you fold it up from the right, you'll eventually reach the beginning of the list.
However, if you take an infinite list at a point and you try to fold it up from the left, you'll never reach an end!