Proposal: add exeExtension to System.Info

Dimitry Golubovsky golubovsky at gmail.com
Tue Jul 17 12:52:02 EDT 2007


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


More information about the Libraries mailing list