Extensible Haskell front-end for the Programatica project

What is in this directory (pfe)

This directory contains modules implementing PFE, the Preliminary Front-End.

PFE provides the infrastructure to work with Haskell programs consisting of a number of interdependent modules, stored in files. We use the term project to denote a collection of Haskell modules that are to be processed together by PFE.

PFE has built-in make(1)-like functionality: it automatically processes files in the right order, and caches results between runs to avoid reparsing and reanalyzing files that haven't changed.


PFE provides the following functionality, which is available both in the form of command line tools and as Haskell functions:
Level 0
Project management: creating a project, adding/removing files to a project. Computing the module dependency graph. Various module level queries.
Level 1
Computing some module properties that can be determined locally and that does not require proper parsing.
Level 2
Analysis of import/export specifications, to determine what is in scope on the top level of each module. This is based on the code decribed in our paper A Formal Specification for the Haskell 98 Module System.
Level 3
Proper parsing of Haskell modules, taking fixity declarations into account. The identifiers in the output of the proper parser are decorated so that they are unique and you can tell what original entity they refer to.
Level 4
Type checking. The type checker can output a syntax tree decorated with type annotations. It can also perform the dictionary translation.
Level 5
Function level dependency graph. This is done after type checking, to properly account for dependencies involving instance declarations. (The module is called PFEdeps.)
Chase (built on top of level 0)
Import chasing. Searches for source files containing needed modules in specified directories. This function assumes that a module M is stored in a file called M.hs or M.lhs. (This is the only function of PFE that assumes a relation between file names and module names.)
HTML (built on top of level 3)
Conversion to HTML, with highlighting and cross references.


PFE is designed to be extensible in several dimensions:
It should be ease to create new command line tools that inherits and extends the provided functionality.
Language extensions.
PFE is parameterized over the source language parser, so the source language is not hardwired in PFE, but there are some restrictions: See ../property for an example of reusing PFE in an extended language.
Monadic abstraction

Authors: TH
Contact: TH