Tupling is a transformation tactic to obtain new functions, without re
dundant calls and/or multiple traversals of common inputs. It achieves
this feat by allowing each set (tuple) of function calls to be comput
ed recursively from its previous set. In previous works by Chin and Kh
oo [8, 9], a safe (terminating) fold/unfold transformation algorithm w
as developed for some classes of functions which are guaranteed to be
successfully tupled. However, these classes of functions currently use
static-sized tables for eliminating the redundant calls. As shown by
Richard Bird in [3], there are also other classes of programs whose re
dundant calls could only be eliminated by using dynamic-sized tabulati
on. This paper proposes a new solution to dynamic-sized tabulation by
an extension to the tupling tactic. Our extension uses lambda abstract
ions which can be viewed as either dynamic-sized tables or application
s of the higher-order generalisation technique to facilitate tupling.
Significant speedups could be obtained after the transformed programs
were vectorised, as confirmed by experiment.