WinHugs is a friendly Windows user interface to Hugs. In addition to the console commands of Hugs (see Chapter 2), it provides:
colorized prompt and various other items to aid reading.
hyperlinks (underlined and in blue); clicking on a hyperlink in an error message opens an editor at the offending line.
a convenient dialog for control of options.
menu and button shortcuts for various commands, such as load.
browse commands to view the class hierarchy and items in scope.
In addition, some escape codes are supported, in particular those which change the foreground and background color.
Example 4-1. Getting started with WinHugs
The graphical interface is mostly self-explanatory, but this is a small introduction to the most commonly used features.
Create a file called Main.hs, and inside put the text
module Main where main = putStrLn "Hello, WinHugs!Note that this program contains a syntax error: the closing quote is missing. Now run WinHugs, and click on open (File->Open) and browse to the file Main.hs. When WinHugs loads the file, it reports an error, along with a link giving its location. Click on this link, and the file will open in your editor, at the appropriate line. (If the file doesn't open at the correct line, visit the options, and under the WinHugs tab set the Editor value appropriately.)
After you've fixed the error, save the file, switch back to WinHugs and click on the Run button. WinHugs will automatically reload your file, and you can watch it produce a message.