WG211/M3Taha
Walid Taha
Title:
A monadic approach to avoiding code duplication
Speaker: [Walid Taha]
Slides: MonadsforCodeDuplication.pdf
Abstract:
Building program generators that do not duplicate generated code can
be challenging. At the same time, code duplication can easily increase
both generation time and runtime of generated programs by an
exponential factor. We identify an instance of this problem that can
arise when memoized functions are staged. Without addressing this
problem, it would be impossible to effectively stage dynamic programming algori
thms. Intuitively, direct staging undoes the effect
of memoization. To solve this problem once and for all, and for any
function that uses memoization, we propose a staged
monadic combinator library. Experimental results confirm that the
library works as expected. Preliminary results also indicate that
the library is useful even when memoization is not used.
For more information, please see the [PEPM 2006 paper] describing this approach.