Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upArray has unwanted side effects - duplicates elements #893
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Aug 7, 2017
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Aug 7, 2017
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sigurdsa
commented
Aug 7, 2017
|
Able to reproduce on Firefox 54.0.1 also |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Skinney
Aug 7, 2017
Contributor
This is fixed in the upcoming Elm 0.19.
If you need a working version NOW, then you can use the package Skinney/elm-array-exploration.
|
This is fixed in the upcoming Elm 0.19. If you need a working version NOW, then you can use the package |
okkero commentedAug 7, 2017
•
edited
Edited 1 time
-
okkero
edited Aug 7, 2017 (most recent)
Description
When using
Arrayunder certain circumstances, elements in the array are duplicated when they shouldn't be. This makes some array operations impure. I can only guess that this is due to a bug in the code that handles persistent data structures in the runtime (doesArraymap more or less directly to JavaScript's array under the hood?).Example that exhibits the problem
Check out this example: https://ellie-app.com/3W8CQfWkjfSa1/4 (I tried making it as short as possible and still keeping the bug)
This is a small portion of an app that I'm working on. It's a relatively unstyled version of a dialog box for configuring a graph, wherein you can select which parameters are shown on which axis.
Steps to reproduce
Setupbuttonabcparameter in the first list, by clicking on itvabcshould be back in the first list.Setupagain. Observe howabchas been moved back to the first list, but that it has also been duplicated and still exists in the second list.Debugand click theClickMoveTomessage,abcwill be duplicated again. Keep clicking this message andabcwill keep duplicating. This is not expected nor correct behaviour.Additional information
I have tested the same code with the difference that the
Arrays have been replaced withLists. Now the app works as expected.I have only tested this on Windows 10, on Google Chrome Version 60.0.3112.90, but I am willing to bet that it happens on all browsers and OSes.