Skip to content

accum is strict on the update list. #555

@Superstar64

Description

@Superstar64

Consider the following:

> length $ Vector.accum undefined (Vector.replicate 10 ()) undefined
*** Exception: Prelude.undefined

Since accum never changes the length of the vector, the result here should clearly be 10, however the accumulate list is evaluated.

Here's a workaround for this:

> length $ Vector.generate 10 (Vector.accum undefined (Vector.replicate 10 ()) undefined Vector.!)
10

If it's like this for performance, then this strictness and the workaround should be documented.

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