Proposal: Add getFullProgName

Heinrich Apfelmus apfelmus at
Wed Jun 20 11:02:01 CEST 2012

Johan Tibell wrote:
> On Tue, Jun 19, 2012 at 8:54 AM, Johan Tibell <johan.tibell at>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


More information about the Libraries mailing list