3 ms·
In Haskell, foldr can sometimes produce output as soon as it sees the first cons. So you don't have to wait for the whole list, which may be infinite.
by eru 16y ago
In Haskell, foldr can sometimes produce output as soon as it sees the first cons. So you don't have to wait for the whole list, which may be infinite.