Entering and editing items in a documentTo enter an item in a document:
- Click the mouse to place the cursor at the desired location in the document;
- Type the item (a single line only) into the field at the top of the window, and terminate with a newline.
- Declarations are entered directly as they are; expressions are prefixed with a "?", comments are (as usual) prefixed by "--".
- Note that module headings (eg,
module Test(test) where) are generated automatically and so should not be included.
- A module is (automatically) named when the
Save ascommand is used. This command pops up a dialog box requesting a module name (such as "Demo").
To move or edit an existing item in a document:
- Click the mouse to place the cursor in the handle of the desired item;
- Reposition the item by dragging its handle to the desired location;
- Edit it by editing the text in the field at the top of the window, and terminate with a newline.
- An item can be deleted using the
Delete itembutton on the toolbar.
CommentsComments in a document can be of two kinds: plain comments or marked-up comments. The former are ordinary Haskell comments, the latter (which are indicates by a leading "#" in a comment) can include a subset of HTML markup tags. The following HTML tags are recognised:
- b - for bold
- i - for italic (the default)
- big - for increasing text size (may be iterated)
- small - for decreasing text size
- tt - for fixed-width font ("teletype")
- sup - superscript
- sub - subscript
spantag allows the following attributes to be specified:
- size - specifies the font size (eg, "x-large")
- foreground - specifies the font colour (eg, "red")
- font_family - (eg, "Sans")
- underline - can be "single" or "double"
For example, the comments in this document are produced by the following entries:
-- A plain comment -- # A marked-up comment -- # <big>A major comment</big> -- # Some <b>bold faced text</b> -- # x<sup>2</sup> + y<sup>2</sup> = z<sup>2</sup> -- # A comment with <span foreground="red" underline="double">some double red underlining</span>
Error handlingAny error in a declaration aborts all evaluation in a document. The GHC compiler error message appears in the command window from which the system was invoked.
An error in an expression aborts evaluation of that expression, but (assuming it does not cause exhaustion of resources) does not affect evaluation of other expressions in a document.
Control of evaluationEvaluation of all expressions in a document may be stopped by pressing the "Eval ?" button on the toolbar. This is useful when editing a document that contains expressions (such as those related to the processing of large images) whose evaluation unduly impairs the responsiveness of the GUI.
Saving documents to fileDocuments may be saved to file (in the
modulesdirectory) using the
Save ascommands. A new module is automatically named
Main. Its name may be changed using the
Save ascommand. A module with name Name is saved as file Name.hs.
Documents are saved as ordinary Haskell files. The location of items in a document are saved as comments like
-- <50,100>and free-standing Haskell expressions in a document are saved as comments like
-- ? foldr `Super` NoPic pics