TY - JOUR
T1 - Manipulating accumulative functions by swapping call-time and return-time computations
AU - Morihata, Akimasa
AU - Kakehi, Kazuhiko
AU - Hu, Zhenjiang
AU - Takeichi, Masato
PY - 2012/5
Y1 - 2012/5
N2 - Functional languages are suitable for transformational developments of programs. However, accumulative functions, or in particular tail-recursive functions, are known to be less suitable for manipulation. In this paper, we propose a program transformation named "IO swapping" that swaps call-time and return-time computations. It moves computations in accumulative parameters to results and thereby enables interesting transformations. We demonstrate effectiveness of IO swapping by several applications: deforestation, higher order removal, program inversion, and manipulation of circular programs.
AB - Functional languages are suitable for transformational developments of programs. However, accumulative functions, or in particular tail-recursive functions, are known to be less suitable for manipulation. In this paper, we propose a program transformation named "IO swapping" that swaps call-time and return-time computations. It moves computations in accumulative parameters to results and thereby enables interesting transformations. We demonstrate effectiveness of IO swapping by several applications: deforestation, higher order removal, program inversion, and manipulation of circular programs.
UR - http://www.scopus.com/inward/record.url?scp=84863305961&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84863305961&partnerID=8YFLogxK
U2 - 10.1017/S0956796812000111
DO - 10.1017/S0956796812000111
M3 - Article
AN - SCOPUS:84863305961
SN - 0956-7968
VL - 22
SP - 275
EP - 299
JO - Journal of Functional Programming
JF - Journal of Functional Programming
IS - 3
ER -