Skip to content

Bug of Data.List.Lazy take #138

Closed
Closed
@ibara1454

Description

@ibara1454

My English isn't good so feel free to ask me if there is anything unclear.

Problem

I found a problem that take evaluate the value too early.
It always evaluate the next value which we don't need.

To show this, I construct a lazy constructed list (elements in the list will be constructed only when they are needed), and use spy to print the value when the it is evaluated.

Actually

bug_take

Desire

> take 0 lazyl
fromStrict (Nil)

> take 1 lazyl
1
fromStrict ((Cons 1 Nil))

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