Proposal: add exeExtension to System.Info

Hi, While adopting my older program to the newer (GHC 6.6) infrastructure, I came across the issue: OS-dependent functions like exeExtension are missing in the newer version of the FilePath package. I checked with Neil who currently maintains FilePath, and he agreed with me on this idea. I am proposing to add the following to the System.Info module (which seems to be the best place to collect OS-specific things) - the code was found in Distribution.Compat.FilePath and slightly modified (#if directive) in the same way as the current System.FilePath distinguishes between Posix and Windows interfaces: ------------------------------- begin -------------------------------------- -- | Extension for executable files -- (typically @\"\"@ on Unix and @\"exe\"@ on Windows or OS\/2) exeExtension :: String #if defined(mingw32_HOST_OS) || defined(__MINGW32__) exeExtension = "exe" #else exeExtension = "" #endif -- | Extension for object files. For GHC and NHC the extension is @\"o\"@. -- Hugs uses either @\"o\"@ or @\"obj\"@ depending on the used C compiler. objExtension :: String objExtension = "o" -- | Extension for dynamically linked (or shared) libraries -- (typically @\"so\"@ on Unix and @\"dll\"@ on Windows) dllExtension :: String #if defined(mingw32_HOST_OS) || defined(__MINGW32__) dllExtension = "dll" #else dllExtension = "so" #endif ------------------------------- end -------------------------------------- Thanks -- Dimitry Golubovsky Anywhere on the Web

Hello Dimitry, Tuesday, July 17, 2007, 8:52:02 PM, you wrote:
I am proposing to add the following to the System.Info module (which seems to be the best place to collect OS-specific things) - the code
why not to add them to FilePath library instead? base isn't good place for any improvements because one cannot use newer base versions without upgrading GHC itself -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi Bulat,
I am proposing to add the following to the System.Info module (which seems to be the best place to collect OS-specific things) - the code
why not to add them to FilePath library instead?
Dimitry asked me about this, I said that its probably not the right place. Which extensions should be used are not related to the way of handling filepath's, they are a System specific piece of information. It's best to put stuff where they belong, rather than avoid base like the plague because its hard to upgrade. The solution to that problem is modifying base or GHC appropriately. Thanks Neil

On Tue, 2007-07-17 at 12:52 -0400, Dimitry Golubovsky wrote:
Hi,
While adopting my older program to the newer (GHC 6.6) infrastructure, I came across the issue: OS-dependent functions like exeExtension are missing in the newer version of the FilePath package. I checked with Neil who currently maintains FilePath, and he agreed with me on this idea.
I am proposing to add the following to the System.Info module (which seems to be the best place to collect OS-specific things) - the code was found in Distribution.Compat.FilePath and slightly modified (#if directive) in the same way as the current System.FilePath distinguishes between Posix and Windows interfaces:
Sounds sensible to me. Want to make a library submission? http://www.haskell.org/haskellwiki/Library_submissions Duncan

Duncan,
On 7/18/07, Duncan Coutts
I am proposing to add the following to the System.Info module (which seems to be the best place to collect OS-specific things) - the code [skip]
Sounds sensible to me.
Want to make a library submission?
Thanks, I'll take a look at this. Part of the code worked inserted into my own code. -- Dimitry Golubovsky Anywhere on the Web
participants (4)
-
Bulat Ziganshin
-
Dimitry Golubovsky
-
Duncan Coutts
-
Neil Mitchell