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 upPorts are not published in the specified order #730
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Oct 13, 2016
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
Oct 13, 2016
|
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.
DavidDTA
commented
Oct 13, 2016
|
In answer to the robot's questions, I'm using Chrome and Elm 0.17.1. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Oct 13, 2016
Contributor
What makes you think this is a bug? Is there any documentation out there that claims any guarantees about the order of stuff happening that is put into Cmd.batch? (Hint: I don't think there is. And there should not be.)
If there is nothing like that to be found, then this is not a bug, but instead some feature you want (order preservation on stuff put into Cmd.batch). In that case, the issue tracker is not the appropriate venue for such a feature request. Such discussions happen on Slack or on the mailing list.
|
What makes you think this is a bug? Is there any documentation out there that claims any guarantees about the order of stuff happening that is put into If there is nothing like that to be found, then this is not a bug, but instead some feature you want (order preservation on stuff put into |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
DavidDTA
Oct 14, 2016
I tried posting to the elm discuss mailing list following your suggesion, but it has not gone through yet (pending approval).
DavidDTA
commented
Oct 14, 2016
|
I tried posting to the elm discuss mailing list following your suggesion, but it has not gone through yet (pending approval). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Oct 14, 2016
Contributor
Okay, I'm sure the message will get through on the mailing list, so am closing the issue here.
Meanwhile, maybe this helps you as well: http://faq.elm-community.org/17.html#what-is-the-difference-between-cmd-and-task
Note that it talks about multiset in relation to Cmd. Multisets have no order.
|
Okay, I'm sure the message will get through on the mailing list, so am closing the issue here. Meanwhile, maybe this helps you as well: http://faq.elm-community.org/17.html#what-is-the-difference-between-cmd-and-task Note that it talks about multiset in relation to Cmd. Multisets have no order. |
jvoigtlaender
closed this
Oct 14, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
DavidDTA
Oct 14, 2016
A few questions about the linked article:
- The article claims that
Cmdis not monadic, but I believe that the existence ofCmd.Extra.messageandCmd.mapindicates that it is. - The article mentions that APIs generally expose
Taskin favor ofCmd. Why is the port APIa -> Cmd msginstead ofa -> Task Never ()or something like that? - Is there a recommended way to pass data to ports in order? I've come up with the workaround of sending over only one port per update and using
Cmd.Extra.messageto trigger additional updates immediately, but I don't think it's very clean.
DavidDTA
commented
Oct 14, 2016
|
A few questions about the linked article:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Oct 14, 2016
Contributor
All these are good questions. For the mailing list.
But let me answer the first one quickly: For something to be monadic, you need not just (in Haskell terms) "something like return" and "something like fmap", which is what Cmd.Extra.message and Cmd.map are. You also need "something like >>=". And that's exactly what Cmd does not have. Thus it is not monadic. Maybe your understanding of "monadic" is wrong/incomplete.
|
All these are good questions. For the mailing list. But let me answer the first one quickly: For something to be monadic, you need not just (in Haskell terms) "something like |
DavidDTA commentedOct 13, 2016
•
edited
Edited 1 time
-
DavidDTA
edited Oct 13, 2016 (most recent)
When using a
Cmd.batchto send data over two ports, the ports receive an event in the same order regardless of the order in which they appear in the batch.Working example:
https://daviddta.github.io/elm-port-order-bug/
Code:
https://github.com/DavidDTA/elm-port-order-bug
Looking at the console, we see that port one always receives the event before port two.