- Haskell declarations;
- Haskell expressions (prefixed with a "?") and displayed along with their values;
- Haskell comments (which may include HTML markup).
For example, here is a simple document:
Documents correspond to Haskell modules; the name of the module is displayed in the upper right
corner of the document. Documents are saved in the form of ordinary .hs files (with
expressions and markup embedded as additional comments).
Liveness
Documents are live in the sense that any changes the user makes to a document are immediately reflected in the displayed values. In this sense, Pivotal documents behave like spreadsheets.Items in a document may be changed in two ways:
- By selecting them and editing their text. (The handle of a selected item is shown in red and its text is displayed in the Edit field at the top of the window. In the above example, the second declaration has been selected.)
- By mouse operations on the (pictorial) values of user-defined types, as described in the section on direct manipulation of ADTs.
Display of values
The value of each expression in a document is automatically displayed after the expression. The way that this is done is defined by theDisplay class, a graphical
analog of the Show class that text-based systems (such as Hugs or ghci) use.
The end effect is that:
- values of the standard types defined in the Haskell prelude are displayed textually;
- values of the built-in type
Pic(ie, pictures) are displayed pictorially; - values of user-defined types are displayed in a user-defined way.
Display class are described in the
section on the display of ADTs.