Skip to content

shuffle function is not actually pure functional #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
djcsdy opened this issue Mar 2, 2021 · 2 comments
Closed

shuffle function is not actually pure functional #45

djcsdy opened this issue Mar 2, 2021 · 2 comments
Labels

Comments

@djcsdy
Copy link
Member

djcsdy commented Mar 2, 2021

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.

@djcsdy djcsdy added the bug Something isn't working label Mar 2, 2021
Copy link

github-actions bot commented Dec 5, 2023

🎉 This issue has been resolved in version 7.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Dec 6, 2023

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant