Closed
Description
Currently, Data.List.Lazy defines foldr
in terms of foldl
on a reverse
d list. This preserves stack safety.
Might it be worth sacrificing stack safety to allow foldr
to work with potentially very large or infinite lists by using the naive definition (trusting the user to use a lazy operation)? If not, is that worth having as a separate function?
Quick example of a consequence of the current def: a function like traverse_
has to wait until the entire list is traversed before actions can begin.
Metadata
Metadata
Assignees
Labels
No labels