Thank you all for responding.
However, I have kept my solution (for now at least). I think the
"thinking" time is not long enough to make it unacceptable.
If you are interested, here are the code:
https://github.com/grzegorzbalcerek/chess-elm and the live app:
http://www.grzegorzbalcerek.net/elm/Chess.html
By the way, elm-repl was very useful, thanks!
And I noticed, that the changes in my source files are automatically
noticed (loaded) by the repl. Awesome!
I tried yet another approach -- I wanted to make a "signal loop" by
merging my foldp output with the input signal.
Something like this:
input ------> merge------> foldp
------------+-------------> render the screen
^ |
| |
| |
| |
| |
+----- lift ---- keepIf -------+
My goal was to generate additional input events from the foldp
logic.
However, when running the code I got this:
Cannot read property 'kids' of undefined
Open the developer console for more details.
And the dev console reports:
Uncaught TypeError: Cannot read property 'kids' of undefined
elm-runtime.js:3086
Uncaught TypeError: Cannot read property 'id' of undefined
elm-runtime.js:3074
Uncaught Error: The notify function has been called synchronously!
This can lead to frames being dropped.
Definitely report this to
<https://github.com/evancz/Elm/issues>
Should I report it? I am not sure, since I am maybe doing something
that elm is not prepared to handle.
Grzegorz Balcerek
W dniu 2014-07-05 17:08, Evan Czaplicki
pisze: