Skip to content

shuffle function is not actually pure functional #45

Description

@djcsdy

The shuffle function is not pure functional, it's stateful by definition and by design.

Two calls to shuffle(x) with the same parameter x may by design return different results, so it's not referentially transparent.

I'm not sure what I was thinking here. It's useful but flies in the face of the principles of this library.

It would be possible to take a PRNG state as an argument to regain referential transparency but I'm not sure I really want to do that here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions