The Worker/Wrapper Transformation

The worker/wrapper transformation is a technique for transforming a computation of one type into a worker of a different type, together with a wrapper that acts as an impedance matcher between the original and new computations. The technique can be used to improve the performance of functional programs by improving the choice of data structures used.

This web page is a central repository for people using or wanting to understand the worker/wrapper transformation.

Papers

Use Cases

The Worker/Wrapper Transformation is surprisingly general! In has been applied to the following application areas.

Using strictness information
was the original motivating example for this transformation.
CPS translation
is just using an alternative representation for computation.
Memoization
is using a data-structure to represent a function.
Accumulation
is often possible when the result is a monoid; worker/wrapper enables this change of type.
Constructor specialization
creates specialized workers and wrappers.
Cross-function short-cut fusion
uses worker/wrapper to transmit fusion opportunities over function boundaries.

We expect there are many others.

Other Resources

Changes and Suggestions?

These pages are stored as a darcs repo. Feel free to email editor@workerwrapper.comwith changes or darcs patches. The darcs repo can be downloading using

$ darcs get http://www.workerwrapper.com