|
Notes on the subset of Haskell used by Vital.
Programs for Vital are written in a subset of standard Haskell.
The main features not yet implemented, or implemented in a simplified form, are:
- Types
- Type-checking takes place dynamically (that is, at run-time). This means that the interpreter accepts as
valid (and handles correctly) some expressions that would be rejected by a standard static type-checker.
At compile time, type signatures and type annotations are accepted by the parser but ignored.
- Type classes
- Type classes are provided in a simplified form.
- Layout-sensitive syntax
- The parser is insensitive to layout (and so the standard Haskell layout-insensitive notation, using
braces and semicolons, is used to define syntactic structure).
- Monadic I/O operations and exception handling
- There are no monadic I/O primitives (a concept alien to the document-centered approach).
- Some Import/Export constructs
- Only the basic Import declaration and Export list mechanisms are implemented. Aliases
are not recognised.
- Some syntactic constructs
- Some syntactic constructs are omitted, including: "where" clauses, strictness annotations in patterns,
field selection and updating using field labels, function definitions in "let" clauses,
and the monadic "do" construct.
Despite these limitations, the Vital subset of Haskell is adequately expressive to allow programming
in the spirit of Haskell.
Type classes
Vital has a simple dynamic type class mechanism.
Syntax
The syntax of the Vital subset of Haskell
is (with only minor exceptions) identical to that of standard Haskell.
Example
The code for the Vital prelude illustrates typical usage.
| Feedback on any aspect of Vital is welcome. |
Updated Dec 04 |
|