I think there are a bunch of options here:
- The Haskell library for Elm exposes the location of the runtime system in a platform independent way. That is how I get elm-server working even though it is a separate package. The value you'd want is
Language.Elm.runtimeLocation which should be accessible by importing the Language.Elm module in any Haskell program. Should have mentioned this earlier! (For some reason this value does not show up on Hackage, but it is definitely part of the latest release of Elm.)
- Use the hosted runtime idea. The --runtime-location flag specifies a URL. It is often specified as a relative path so I can run it on any domain I want, but you can definitely give an absolute path or HTTP address for the runtime location.
- Distribute as a standalone .js file. Users can use the --include-js flag to import the file into their project.
Do any of these options work for you? Do you expect that your code will be highly version specific or implementation specific?
Also, this issue has not come up before, so if you feel like you need something just let me know. It is likely missing because I have not thought about it, not because it is difficult or un-Elm-y. Can you tell me a bit more about your project? Maybe I can come up with a way to make it easier to create libraries and extensions in general.