ContentsIndex
RefacPwPf
Portability portable
Stability experimental
Maintainer jproenca@di.uminho.pt
Contents
Refactoring
Limitations
Description

Refactoring tool that converts a pointwise to a pointfree expression.

It uses the modules GlobalPW, PWCore, PwPfConversion and Pointfree

Synopsis
pwToPf :: [String] -> State' IO ()
Refactoring

Converts an expression in pointwise to pointfree by the following steps:

  1. Reads the expression to be evaluated obtained by programatica's tools;
  2. Tries to convert the expression to a GLTerm by the use of the monadic function exp2Global, in GlobalPW module;
  3. Converts the GLTerm to a PWTerm, which is more general pointwise representation that can be found in module PWCore, by the use of the function global2core;
  4. Converts the PWTerm to a PFTerm, which is a pointfree expression, by the use of the function core2Pf;
  5. Writes the resulting pointfree expression into an expression of programatica's abstract syntax tree, by the use of the function pf2Exp.
pwToPf :: [String] -> State' IO ()
Limitations

This refactoring is not complete, since only the grammar specified for the function exp2Global can be recognized, and later translated into a pointfree expression.

There are also some limitations. Some of them are presented bellow.

  • Types inside IN, OUT and PARA have the type information correct, but the variable "_L" sometimes don't have the correct location information, and lists are represented by [a], where the letter a may already be bounded;
  • The source location information is ignored in most cases, since the expression is completely changed;
  • Scope information is lost, except for prelude functions;
  • Aditional information to the expression, like type information, cannot be added inside the selected expression, since only the specified grammar is recognized.
Produced by Haddock version 0.6