Skip to content

use naive Lazy List foldr #111

Closed
Closed
@matthewleon

Description

@matthewleon

Currently, Data.List.Lazy defines foldr in terms of foldl on a reversed 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions