I have a problem how to pass Haskell callbacks into JS foreign functions. I followed an example here:
and created the following gist:
The intention is to add another bullet point to the list whenever the user clicks on body (but a true intention is to see how callback passing works). All compiles, however, when I click on body, I get a following error:
Uncaught TypeError: fun is not a function at document.body.onclick (all.js:57263:48) document.body.onclick @ all.js:57263
When I print
fun via a
console.log, it seems that indeed it’s not a function, but rather some complicated object representation. How do I make it executed on user click?