Pivotal is a document-centered presentation of Haskell
. It aims
to provide a user-friendly environment in which Haskell documents can be interactively developed and manipulated.
A Haskell document
is essentially an ordinary Haskell module that may also include free-standing Haskell expressions.
When a document is displayed, the values of any such expressions are evaluated and displayed in-place.
Pivotal and Vital
Pivotal has similar goals to its predecessor system, Vital
. In particular:
- Documents are live in the sense that, if a document is changed, the displayed values are
automatically re-evaluated. Thus documents are always in a consistent state.
- Direct manipulation of ADT values is supported. That is, an end user is able to manipulate the
text of a Haskell module simply by point-and-click mouse operations on displayed values.
Unlike Vital, however, Pivotal is implemented
entirely in Haskell.
This website describes a very basic
prototype of Pivotal, developed
to establish the feasibility of the approach. It provides only a skeletal
implementation of most features and omits many other desirable ones entirely.
Here is an example of a Pivotal document (
). Reading from the top, it consists of:
- A declaration for the factorial function.
- An expression (as indicated by the leading "?") involving the factorial function, together with its value.
- An expression,
Rect red False 50 30, for a value (of type
pre-defined type for "pictures") that displays as an (unfilled) red
rectangle of size 50 x 30 pixels.
- An expression that displays as a (filled) 270 degree sweep of an ellipse of the same dimensions.
- An expression (involving a recursive "
let" component) that defines a picture consisting
of an infinite sequence of small rectangles. The expression is evaluated lazily to the
depth required to render the portion of the picture that is visible in the window.
- A declaration for a constant,
pic, (again of type
Pic) for an image
read in from a .png file, followed by the expression
pic that displays this picture.
- A declaration that binds the variables
bm to (resp.)
the width, height and bit-map (a function of type
Int -> Int -> Color) of this image.
- An expression,
Bitmap h w (flip bm), that transposes the two arguments of the bitmap function and hence
transposes the picture.
The overall Pivotal project is being undertaken by Keith Hanna
and Stefan Kahrs
Functional Programming group
at Univ of Kent
. Comments or
suggestions are very welcome.