TY - GEN
T1 - Shortcut fusion rules for the derivation of circular and higher-order monadic programs
AU - Pardo, Alberto
AU - Fernandes, João Paulo
AU - Saraiva, João
PY - 2009
Y1 - 2009
N2 - Functional programs often combine separate parts using intermediate data structures for communicating results. These programs are modular, easier to understand and maintain, but suffer from inefficiencies due to the generation of those gluing data structures. To eliminate such redundant data structures, some program transformation techniques have been proposed. One such technique is shortcut fusion, and has been studied in the context of both pure and monadic functional programs. Recently, we have extended standard shortcut fusion: in addition to intermediate structures, the program parts may now communicate context information, and it still is possible to eliminate those structures. This is achieved by transforming the original function composition into a circular program. This new technique, however, has been studied in the context of purely functional programs only. In this paper, we propose an extension to this new form of fusion,but in the context of monadic programming: we derive monadic circular p ograms from strict ones, maintaining the global effects. Later, the circularities in the derived programs are traded by highorder definitions, using a well-known program transformation technique. We finally obtain very efficient deforested programs. An important feature of our extensions is that they can beuniformly defined for a wide class of data types and monads, using generic calculation rules.
AB - Functional programs often combine separate parts using intermediate data structures for communicating results. These programs are modular, easier to understand and maintain, but suffer from inefficiencies due to the generation of those gluing data structures. To eliminate such redundant data structures, some program transformation techniques have been proposed. One such technique is shortcut fusion, and has been studied in the context of both pure and monadic functional programs. Recently, we have extended standard shortcut fusion: in addition to intermediate structures, the program parts may now communicate context information, and it still is possible to eliminate those structures. This is achieved by transforming the original function composition into a circular program. This new technique, however, has been studied in the context of purely functional programs only. In this paper, we propose an extension to this new form of fusion,but in the context of monadic programming: we derive monadic circular p ograms from strict ones, maintaining the global effects. Later, the circularities in the derived programs are traded by highorder definitions, using a well-known program transformation technique. We finally obtain very efficient deforested programs. An important feature of our extensions is that they can beuniformly defined for a wide class of data types and monads, using generic calculation rules.
KW - Circular programming
KW - Deforestation
KW - Monadic programming
KW - Program calculation
KW - Shortcut fusion
UR - http://www.scopus.com/inward/record.url?scp=67650691955&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=67650691955&partnerID=8YFLogxK
U2 - 10.1145/1480945.1480958
DO - 10.1145/1480945.1480958
M3 - Conference contribution
AN - SCOPUS:67650691955
SN - 9781605583273
T3 - Proceedings of the 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
SP - 81
EP - 90
BT - Proceedings of the 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
T2 - 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
Y2 - 19 January 2009 through 20 January 2009
ER -