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 upGraphics.Input crashes if Text is not imported #203
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Mar 24, 2015
Contributor
Note: I encountered this problem as I tried to answer this thread on the mailing list: https://groups.google.com/forum/#!topic/elm-discuss/7aG8wS2jnBI
Kinda weird to try to explain the relationship between buttons and signals when buttons don't work.
|
Note: I encountered this problem as I tried to answer this thread on the mailing list: https://groups.google.com/forum/#!topic/elm-discuss/7aG8wS2jnBI Kinda weird to try to explain the relationship between buttons and signals when buttons don't work. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Mar 24, 2015
Contributor
Actually, there's even a more minimal example of the bug:
import Graphics.Input (button)
badButton = button |
Actually, there's even a more minimal example of the bug: import Graphics.Input (button)
badButton = button |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Mar 24, 2015
Contributor
This seems to be true of all functions in the Graphics.Input package.
import Graphics.Input
badButton = Graphics.Input.dropDownyields the same error.
|
This seems to be true of all functions in the import Graphics.Input
badButton = Graphics.Input.dropDownyields the same error. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 24, 2015
Member
Thanks for the reports, if you want to take a swing at it that'd be great. I am relatively overloaded, so it is not feasible for me to address every issue that comes up immediately.
As an aside about mailing list / issue protocol, can you try to do more drafting and revising such that we don't get 3+ messages in a row that could have been one? Both here and on the mailing list it makes it much harder to follow the thread of conversation, you have to do a lot of summarizing in your mind that could have been done by the author. I mean no offense at all when I say this! I just think it makes things artificially difficult, and it'd be pretty easy for everyone to have a better situation.
|
Thanks for the reports, if you want to take a swing at it that'd be great. I am relatively overloaded, so it is not feasible for me to address every issue that comes up immediately. As an aside about mailing list / issue protocol, can you try to do more drafting and revising such that we don't get 3+ messages in a row that could have been one? Both here and on the mailing list it makes it much harder to follow the thread of conversation, you have to do a lot of summarizing in your mind that could have been done by the author. I mean no offense at all when I say this! I just think it makes things artificially difficult, and it'd be pretty easy for everyone to have a better situation. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Mar 24, 2015
Contributor
No offense taken. I'll try my best. Sometimes I write several messages in a row because I had several thoughts in a row spread across the day.
In this case, I just reported the error and didn't think I could find anything but then found a few more things along the way.
Now, that said, I found why this has happened:
The following code totally works.
import Text
import Graphics.Input (button)
okButton = buttonThis might be potentially an issue for elm-compiler. Basically, in the Native Javascript, Graphics.Input requires the use of Text but not in the Elm code. Well, there is an import Native.Text but I suspect it to be somewhat broken or something went wrong in the code generation.
If it is in fact the case that it's the compiler's fault, then this is beyond my expertise. Maybe I'll modify the import line to import Text instead of import Native.Text but that sounds like just patching one instance of a bug rather than solving a deeper problem.
|
No offense taken. I'll try my best. Sometimes I write several messages in a row because I had several thoughts in a row spread across the day. In this case, I just reported the error and didn't think I could find anything but then found a few more things along the way. Now, that said, I found why this has happened: The following code totally works. import Text
import Graphics.Input (button)
okButton = buttonThis might be potentially an issue for elm-compiler. Basically, in the Native Javascript, If it is in fact the case that it's the compiler's fault, then this is beyond my expertise. Maybe I'll modify the import line to |
TheSeamau5
changed the title from
Graphics.Input buttons do not work
to
Graphics.Input crashes if Text is not imported
Mar 24, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Mar 24, 2015
Contributor
It seems that in the end there's already such an issue in elm-compiler. It seems to be a bug in elm-make. I'm thus closing the issue here and move the findings to elm-compiler.
|
It seems that in the end there's already such an issue in elm-compiler. It seems to be a bug in elm-make. I'm thus closing the issue here and move the findings to elm-compiler. |
TheSeamau5
closed this
Mar 24, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 24, 2015
Member
I think @mgold fixed this bug in the latest version of core. Is there a closed issue about adding a Text import?
|
I think @mgold fixed this bug in the latest version of core. Is there a closed issue about adding a Text import? |
TheSeamau5
referenced this issue
Mar 24, 2015
Closed
Removing unused Text import breaks compiled elm.js #864
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheSeamau5
Mar 24, 2015
Contributor
Actually, I take that back, it's fixed. What I saw was a different bug o_0.
If you're interested, it's caused by the following code:
import Graphics.Input exposing (button)
import Port exposing (Port, message)
port num : Port Int
b = button (message num.address 0) ""which yields :
Cannot read property 'arity' of undefined
Open the developer console for more details.
|
Actually, I take that back, it's fixed. What I saw was a different bug o_0. If you're interested, it's caused by the following code: import Graphics.Input exposing (button)
import Port exposing (Port, message)
port num : Port Int
b = button (message num.address 0) ""which yields :
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 24, 2015
Member
Probably has to do with implementation changes happening in 0.15 so that looks like something we can find and fix.
|
Probably has to do with implementation changes happening in 0.15 so that looks like something we can find and fix. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mgold
Mar 24, 2015
Contributor
Seems right to me -- the import Text has been fixed but this arity stuff is new.
|
Seems right to me -- the import Text has been fixed but this arity stuff is new. |
TheSeamau5 commentedMar 24, 2015
Buttons from Graphics.Input do not work.
The following code :
causes the following error :
Note: this problem also exists in the latest commits.