Ok, my bad! Thank you @luke for correcting me.
I don’t know why I thought those functions was used during port process. I’ve checked what I’ve done and I don’t use these functions neither.
So my claim was wrong.
In the case we would want to use typescript to get rid of the encoding part, I wonder if we should care about “copy” the function argument in order to prevent mutation by the caller. If we do:
arg = { b: 5};
res = elmModule.f(arg);
arg.b = 4;
this should not bother f
. But is it possible for arg
to be modified in another place (say it is a global variable), during the execution of f
?