Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#1590 closed proposal (wontfix)

Libraries proposal: Add System.Info.isWindows

Reported by: neil Owned by:
Priority: normal Milestone: Not GHC
Component: libraries/base Version:
Keywords: Cc: ndmitchell@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Currently the recognised way to test if your application is being run on Windows is:

import System.Info

.... = os == "mingw"

This is wrong on so many levels!

# The return result of os is NOT an operating system # The result mingw does not imply that mingw is installed # String comparisons are not very safe, a typo stops this working # In GHC this comparison will take place at runtime, even though its a constant

Since nearly all uses of System.Info.os are to check if the operating system is Windows, adding an explicit isWindows function would simplify things.


Add System.Info.isWindows :: Bool

This value should return True on all Windows systems (Win 1.0 ... Vista), and False on all other systems.


2 weeks from the end of discussion. Please discuss on the libraries@ mailing list.

Change History (4)

comment:1 Changed 10 years ago by igloo

Type: feature requestproposal

comment:2 Changed 9 years ago by igloo

Resolution: wontfix
Status: newclosed

This proposal seems to be abandoned

comment:3 Changed 8 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 8 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.