Library proposal: Add System.Info.isWindows

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Aug 16 07:33:46 EDT 2007


On Thu, 2007-08-16 at 09:02 +0200, Ketil Malde wrote:
> On Wed, 2007-08-15 at 16:49 +0100, Ian Lynagh wrote:
> > On Wed, Aug 15, 2007 at 03:40:56PM +0100, Neil Mitchell wrote:
> 
> > > By modifying your proposal ever so slightly (and probably as you
> > > intended anyway):
> 
> > > > data OSFlavour = Linux | Windows | MacOS | BSD | Solaris | Other String
> > > >                           deriving Eq
> 

> Seriously, I worry this will always be too coarse.  What features are
> people actually using conditionally like this?

There are many examples in Cabal, almost all of them just distinguish
windows vs non-windows and are for things like:
      * deciding what default installation directories to use
      * whether it is possible to make relocatable packages or not
      * how to generate the Paths_<pkg>.hs file (which has to FFI import
        some win32 functions on windows to implement relocatable
        packages). 
      * It distinguishes for generating a sh shell script or a batch
        file for the register --gen-script feature
      * special logic to find some tools that are bundled with ghc in a
        subdir vs just looking on the path as normal


Duncan



More information about the Libraries mailing list