The thread is closed, but here is an asynchronous Platform.worker using 0.19 based on @rupert 's excellent response; I hope that this is an acceptable way to pass on this information.
Thanks for the suggestion but it is not exactly what I was looking for.
The reason I wanted specifically the synchronous version is that it would be nice to just replace some JS functions with Elm functions. But since there is no way to have a synchronous Elm call from JS it is not possible to “just” replace some JS function with Elm function. I’m forced to first make that JS function asynchronous which is a breaking change for most of my code.
The output of the compiler is readable JS. With each version there is a specific format for this output. This can be used to process this output, for example, adding a specific function or a family of functions to the exports.
Please note that this qualifies as a “hack” solution and I’m not really recommending this, especially because the format is an implementation detail that should not be used BUT, you can do it.
Just look at the output of an elm compilation and use your JS knowledge to try to understand it and understand how an automated tool could help you.
That doesn’t sound like a viable solution to me. The output can be changed with any hotfix and it would be quite some work to reverse engineer the inner working of Elm so I can strip out unnecessary stuff.
This is unfortunately the way I’m not willing to go.