
Johan Tibell wrote:
On Tue, Jun 19, 2012 at 8:54 AM, Johan Tibell
wrote: Since
* we can't implement this reliably, * the distinction into these three groups doesn't necessarily work for all compilers, and * the distinction (I assume) isn't useful in most use cases
Another problem with the executable-path like distinction is that it's no longer possible to find out which executable (i.e. ghc) is running the script. At a minimum the Script and Interactive constructors would have to expose that.
getExecutablePath :: IO FilePath
has a clear meaning: return the path to the executable that's currently executing.
That's true, I think the well-defined semantics are a clear point in favor of the simple getExecutablePath function. The only trouble I have is that these semantics don't seem to be useful. For what purpose would you like to know the executable path? The only use case that I have encountered is to find data files relative to the program, but in this case, I need it to work equally well in GHCi, runghc and compiled. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com