The mintty library provides a simple way to detect if your code in running in a MinTTY console on Windows. As you might expect, it will simply return False on any non-Windows operating system. After uninstalling, run this command to unregister the package from the ghc package database: ghc-pkg recache