tungsten
is a (highly experimental) library bringing deforestation to any recursive structure for free.
The only prerequisite is to define the concerned structure as a fixed-point using the provided Fix
operator from the Tungsten.Fix
module. It also defines a generalization of the foldr/build
rewrite rule, targeting catamorphisms on any fixed-point structures.
Haddock-generated documentation is available at https://nobrakal.github.io/tungsten/
Some examples of use can be seen in:
See a more-or-less formal proof in doc/validity.md
.
Even if valid from a theoritical point of view, does it work?
Some tests can be found in the test/
directory. They use the great inspection-testing
package to test rewrite-rules firing.
Be sure to compile with rewrite rules enabled and the -fspec-constr
flag.
Tungsten is the metal with the highest fusion (or melting) point.