Open ghost opened 10 years ago
Apparently Array overrides the Javascripts default Array type which causes an error in elm. I'm trying to initialize a port with a tuple.
foo.elm
module MyFoo where import Array port fooPort : Signal (Int, Int) main = plainText (show fooPort)
index.html
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"><title>foo</title> <script type="text/javascript" src="elm-runtime.js"></script> <script type="text/javascript" src="elm_dependencies/xashili-Array/0.2.2/Native/Array.js"></script> <script type="text/javascript" src="foo.js"></script> </head> <body> <script type="text/javascript">Elm.worker(Elm.MyFoo, { fooPort : [0, 0] } )</script> </body> </html>
elm -m --script=elm_dependencies/xashili-Array/0.2.2/Native/Array.js --script=foo.js --runtime=elm-runtime.js --only-js foo.elm
Thanks for reporting, never thought of trying this! As Arrays get into the standard library and this is kind of a compiler bug, I opened an issue there: https://github.com/elm-lang/Elm/issues/576
Apparently Array overrides the Javascripts default Array type which causes an error in elm. I'm trying to initialize a port with a tuple.
foo.elm
index.html