Very neat!
Could this work in background tabs? Would be great for a notification feature of multi-browser-tab apps.
What other ports do you have in mind? Maybe we can change main to 'port display'?
--
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/groups/opt_out.
Why would any particular export type be invalid? Aside from importing functions (purity), what's the reason for the restrictions?
Why would any particular export type be invalid?
[1 of 1] Compiling Main ( test.elm )
Type Error: the value sent out through port 'my_port' is invalid.
Acceptable values for outgoing ports include JavaScript values and the following Elm values:
Ints, Floats, Bools, Strings, Maybes, Lists, Tuples, first-order functions, and concrete records.
The values sent through this port contain Algebraic Data Types:
CharArguably Char and [Char] should be converted to Strings. I was surprised to see that unit becomes empty array without any problem. Algebraic data types are not serializable, unless you can think of a JS representation and get the world to agree on it.
Evan, that's a great error message, except for the part where it calls Char an ADT. Maybe change to just "contain the types".Evan, that's a great error message, except for the part where it calls Char an ADT. Maybe change to just "contain the types".
--