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:
Is this valid?
See a more-or-less formal proof in
Is this working?
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.
Is does not work for me!
Be sure to compile with rewrite rules enabled and the
Tungsten is the metal with the highest fusion (or melting) point.