5

i want to execute some effectful computation on a regular basis in a program compiled with GHCJS, but GHCJS.DOM.WindowTimers.setInterval wants a JSVal as parameter. Could anybody give me some pointers for turning my IO () into a JSVal?

Edit:

I was able to match the types using GHCJS.Foreign.Callback.asyncCallback and GHCJS.Types.jsval, but i have eventually got a runtime error. Luite in the GHCJS channel suggested to use threads for this task, as Erik suggested in a comment here. This is explained in the corresponding question

Community
  • 1
  • 1
danza
  • 11,511
  • 8
  • 40
  • 47
  • 2
    you _could_ just use threads and have GHCJS take care of the plumbing. – Erik Kaplun Nov 07 '15 at 01:23
  • this is an answer to a slightly different question, that i created for you here http://stackoverflow.com/questions/33611149/how-to-execute-an-action-periodically-in-a-ghcjs-program :) – danza Nov 09 '15 at 14:18

0 Answers0