Overview of VitalThe main features of the Vital approach are:
Document-centered approachA Haskell program consists of a collection of modules (some written by the user, others imported from a library). A module consists of a collection of items (declarations, expressions and comments) and is displayed as a document. The user constructs a document by placing (in a free-format layout) items on it. The system evaluates the declarations and expressions, and displays their values alongside them. The system is 'live' in the sense that (as with a spreadsheet) changing any part of a document causes an immediate update of all dependent values.
A simple document is shown here. It consists of a comment, a declaration (
Demand-driven evaluationHaskell has a non-strict semantics: expressions are evaluated only to the minimal extent necessary. In Vital, evaluation is demand-driven by the need to display the result. For instance, in the list comprehension expression shown here, evaluation of the infinite list
Documents, however, are notionally infinite in extent and may be
dragged relative to the viewport thus forcing further evaluation and
allowing the nether regions of large or infinite
data structures to be displayed (as shown here).
StylesHaskell values may be displayed either textually or diagrammatically. The way that a Haskell value is displayed is determined by an associated style (itself an ordinary Haskell value). For example, a style can be defined to display a list diagrammatically, with a vertical orientation and with each of its elements boxed. The declarations for a collection of styles may be gathered together as a stylesheet, itself an ordinary Haskell module.
Typically, whenever a user declares a new datatype (concrete or abstract) he will also
specify (by defining an appropriate instance of the
Styles are also used to define the way that comments are displayed and, in particular, to attach hyperlinks to them, facilitating navigation amongst the set of documents making up a complete program.
GraphicsPictures (elements of a predefined
Images (as bitmaps of a predefined type
Libraries (of Haskell modules) can be defined to allow more complex graphical representations.
Here, for example, a library of bar chart drawing functions is imported and used
to draw a chart of the first few digits (3, 1, 4, 1, 5, etc.) of pi.
Direct manipulation of data structuresVital allows a user to select (by mouse) a component of a data structure and then to use Copy and Paste operations to modify or move it. This gives the user a high-level, graphical means of constructing complex literal data structures.
For example, a user wishing to define a triangular array of numeric literals can
first create an 'empty' array
and then point and click to edit data into its cells (in the same way as data is
entered into a spreadsheet).
Direct manipulation of ADT valuesA user-defined set of operations can be associated with any datatype (concrete or abstract). For example, a user dealing with a problem involving binary relations can introduce an ADT for binary relations, and then (by defining an instance of the
A menu of these operations is presented to the user on right-clicking on a binary relation. Selecting one of these operations updates the source text of the declaration/expression and thus (indirectly) the displayed value.
Typically, in any particular domain (engineering, economics, etc.) an expert user would be
called up to identify and implement a library of relevant ADTs. Thereafter, an end user
will be able to put together documents expressed largely in terms of these high-level, domain-specific
abstractions and defining particular instances of them (such as the binary relation illustrated
here) by simple point-and-click operations on pictorial representations.
PersistenceA documents developed in Vital may be saved to file and later restored in an identical state. It is saved as an ordinary Haskell program (with layout and style information embedded as comments, and any stylesheet imported as an ordinary Haskell module). This means that a Haskell program can be developed interactively using Vital and any literal data edited into its data structures, and then (if required) it can be run on an offline Haskell system.