Converts an expression in pointwise to pointfree by the following steps:
- Reads the expression to be evaluated obtained by programatica's tools;
- Tries to convert the expression to a GLTerm by the use of the
monadic function exp2Global, in GlobalPW module;
- 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;
- Converts the PWTerm to a PFTerm, which is a pointfree expression,
by the use of the function core2Pf;
- Writes the resulting pointfree expression into an expression of
programatica's abstract syntax tree, by the use of the function pf2Exp.
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