[Ur] Confusing error message when using effectful javascript ffi function in onload handler

Daniel Patterson dbp at dbpmail.net
Thu Jun 13 20:14:33 EDT 2013


I have an ffi function declared like:

ffi js
jsFunc Js.init=init
effectful Js.init

I have it in my body onload handler as:

Js.init ...

And the error that it produces is:

:0:0: (to 0:0) A link () could cause side effects; try implementing it
with a form instead
make: *** [app] Error 1


Which is confusing because:

a. it has no source location information, so I have no idea where the
error is occuring and

b. it is not caused by a link.

The problem goes away if I either don't say that it is effectful, or
say it is benignEffectful, but I'm not sure why this is - because it
seems like onload handlers should be able to cause effects...



More information about the Ur mailing list