Features of the Programatica Haskell Tools
This page summarizes the features of the
Programatica Haskell Toolkit, which is
- A Haskell front-end, with functionality similar to what you find in a
compiler front-end for Haskell, implemented in Haskell.
- some command line tools and a graphical Haskell browser, built on top of
the Haskell front-end.
See the Usage page for how to use the tools.
It should also be possible for Haskell programmers to reuse our Haskell
front-end in their own Haskell programs, but at the moment
there is very little documentation to support this, unfortunately.
(But it has been used in
HaRe
-- the Haskell refactorer tool from the
University of Kent.)
Summary of functionality
- Lexical analysis, parsing (including operator fixity),
scoping, pretty printing.
- Module-level dependency analysis, to support built-in make(1)-like
module processing.
- Type checking, removing overloading by the dictionary translation,
generating code for derived instances.
- Program transformations: pattern binding removal,
pattern match simplification, function binding simplification,
list comprehension removal.
- Definition-level dependency analysis, dead-code detection, slicing.
- Translation to Alfa/Agda (roughly Cayenne).
- Rendering of Haskell source code as HTML with
accurate syntax highlighting and hyperlinks from uses to definitions.
(See notes on the HTML conversion.)
- Find definitions of a particular identifier.
- Find all uses of a particular entity.
- ...
Supported language
The tools support Haskell 98 as described in the
Haskell 98
Language and Libraries: the Revised Report. It also supports
a number of extensions to varying degree.
n+k patterns are not supported.
Unusually well-supported standard language features
Common Haskell Language extensions
P=lexing/parsing/scoping, T=type checking,
+=implemented, -=not implemented yet, blank=n/a.
P | T | Feature
|
---|
+ |
| Hierarchical module names (i.e. ". " in module names)
|
+ | +
| Multi-parameter classes
|
+ | -
| Functional dependencies (see
Type
Classes with Functional Dependencies)
|
+ | -
| Rank-n polymorphism
(use of the forall keywords in type expression)
|
+ | -
| Existentially quantified types
(use of the forall keyword in data constructor specifications.
|
Programatica specific language extensions
- Predicate definitions, using the
property
keyword.
- Property assertions, using the
assert
keyword.
- P-logic formulas (appear in predicate definitions and property assertions).
Limitations
The tools currently don't implement exhaustive checking for static errors
and might let things like duplicate definitions or repeated variables in
patterns slip through silently.
(Implementing this has been given low priority,
since it has been assumed that the tools will be used as a complement to
other Haskell compilers/interpreters, rather than a replacement.)