tupling

tupling

A program transformation where several results are returned from a single traversal of a data structure. E.g.

mean l = sum l / length l

==>

mean l = s/n where (s,n) = sumLen l

sumLen [] = (0,0) sumLen (x:xs) = (s+x, n+1) where (s,n) = sumLen xs

In procedural languages this technique is known as horizontal loop combination because it uses one loop to calculate several results.

Another form of tupling transformation is used to avoid repeated evaluation where a function generates several identical calls to itself. By analysing the pattern of recursion (see descent function) it is possible to arrange for these identical calls to share results. E.g.

fib 0 = 1 fib 1 = 1 fib n = fib (n-1) + fib (n-2)

==>

fib n = v where (_,v) = fibt n fibt 0 = (1,1) fibt n = (u+v,u) where (u,v) = fibt (n-1)
References in periodicals archive ?
Karl Tupling, general manager for Homes England in the Midlands, said: "The completion of these new units as T54 will continue to offer new opportunities for local businesses and employment.
Karl Tupling, the HCA's general manager for the Midlands, added: "Aldridge Road is a significant development opportunity and an excellent example of the HCA's work to increase house building.
Carl Tupling, executive director for the midlands for the HCA added: "The HCA is pleased to have played a part in securing another new facility at Ansty Park.
This statement often brings up an authentic, "I am not really comfortable with this!" My rejoinder to that might echo the words of Sue Tupling, founder of international PR and marketing firm Changeworks, "Feeling uncomfortable?
To assess parental bonding Parental Bonding Instrument was used (Parker Tupling and Brown 1979).
THE GRASS IS GREENER - The Earth course closed earlier this week as Jumeirah Golf Estates Course superintendent Mark Tupling and his team began the process of overseeding the course in preparation for the arrival of the top 60 players in The Race to Dubai.
During a pre-tournament site inspection, David Garland, the Tour's director of Tour Operations, and Deputy Director of Tour Agronomy Graeme MacNiven received a detailed overview of the Greg Norman-designed course from course superintendent at Jumeirah Golf Estates, Mark Tupling.
Also participating were Julia Sharp, 42, Louise Tupling, 45, and her niece Anna Tupling, 19.
Mishell Dee Mills Tupling, LMP @ Therapeutic Touch, 1601 N.
Mankevetch of Millbury; a daughter, Jean Tupling of FL; eight grandchildren; nine great-grandchildren; two great great-grandchildren; nephews and nieces.
She is now being coached by Peter Tupling, of Cookridge Hall, West Yorkshire who works with Kiran Mathrau, the England player who is now on the professional tour.
Captain Ian Barlow, Captain Philip Bates, Captain Darren Bartlett, Lt Matthew Tupling and cadets Nicholas Orttinger and Andrew Stout are also with the Electrical and Mechanical Engineers.