Signal.merge broken in 0.15?

72 views
Skip to first unread message

Malcolm Cleaton

unread,
Apr 28, 2015, 8:42:18 AM4/28/15
to elm-d...@googlegroups.com
Hi list.

I quite often write Signal.merge Keyboard.wasd Keyboard.arrows, so that I can use either.


Now it starts out with a bogus value, and going forward it ignores the right-hand signal (although with a real program, you've now already crashed inside type-checked code that wasn't expecting a bogus value, eg http://share-elm.com/sprout/553f7ff2e4b06aacf0e89918)

I'm quite inexperienced with elm, so it's not impossible I've misunderstood something, but this seems broken.

Thanks,
Malcolm.



Janis Voigtländer

unread,
Apr 28, 2015, 9:10:30 AM4/28/15
to elm-d...@googlegroups.com

Yes, looks like a bug. Should be fixed by this PR.


--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Janis Voigtländer

unread,
Apr 28, 2015, 9:32:33 AM4/28/15
to elm-d...@googlegroups.com

That is, said PR fixes the “undefined initial value” problem. That merging of Keyboard.wasd and Keyboard.arrows will only ever give the result events from one of them is something that is a real change of semantics, which happened in this commit. Maybe it was an intended change of semantics, maybe not. To recover the 0.14 behavior in this respect, calls to Signal.dropRepeats would have to be wrapped around the Signal.map calls in the definitions of wasd and arrows in Keyboard.elm.

Janis Voigtländer

unread,
Apr 28, 2015, 9:49:02 AM4/28/15
to elm-d...@googlegroups.com

That keyboard signals become meaningfully mergeable again, can be achieved with this PR.

Janis Voigtländer

unread,
Apr 29, 2015, 2:15:19 PM4/29/15
to elm-d...@googlegroups.com
Both issues should now be fixed in the 2.0.1 release of the standard library.

2015-04-28 14:42 GMT+02:00 Malcolm Cleaton <malcolm...@gmail.com>:

Evan Czaplicki

unread,
Apr 29, 2015, 2:19:25 PM4/29/15
to elm-d...@googlegroups.com
Thanks for the fixes Janis!
Reply all
Reply to author
Forward
0 new messages