11.2. Avoiding the console window

By default GHC builds applications that open a console window when they start. If you want to build a GUI-only application, with no console window, use the flag -optl-mwindows in the link step.