Views, Program Transformations, and the Evolutivity Problem in a Functional Language

We report on an experience to support multiple views of programs to solve the tyranny of the dominant decomposition in a functional setting. We consider two possible architectures in Haskell for the classical example of the expression problem. We show how the Haskell Refactorer can be used to transform one view into the other, and the other way back. That transformation is automated and we discuss how the Haskell Refactorer has been adapted to be able to support this automated transformation. Finally, we compare our implementation of views with some of the literature.

[1]  Martin Odersky,et al.  Independently Extensible Solutions to the Expression Problem , 2004 .

[2]  Günter Kniesel,et al.  Static composition of refactorings , 2004, Sci. Comput. Program..

[3]  Philip Wadler,et al.  Views: a way for pattern matching to cohabit with data abstraction , 1987, POPL '87.

[4]  Benjamin C. Pierce,et al.  Combinators for bi-directional tree transformations: a linguistic approach to the view update problem , 2005, POPL '05.

[5]  Benjamin C. Pierce,et al.  Boomerang: resourceful lenses for string data , 2008, POPL '08.

[6]  J. Ferrante,et al.  Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages , 1988 .

[7]  William G. Griswold,et al.  Beyond refactoring: a framework for modular maintenance of crosscutting design idioms , 2007, ESEC-FSE '07.

[8]  Andrew P. Black,et al.  The Case for Multiple Views , 2004, ICSE 2004.

[9]  Daniel Jackson,et al.  Structuring Z specifications with views , 1995, TSEM.

[10]  William G. Griswold Program restructuring as an aid to software maintenance , 1992 .

[11]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[12]  Apostolos Syropoulos,et al.  Steps in Scala: The expression problem , 2010 .

[13]  Olivier Danvy,et al.  Back to Direct Style , 1992, Sci. Comput. Program..

[14]  D. L. Parnas,et al.  On the criteria to be used in decomposing systems into modules , 1972, Software Pioneers.

[15]  Donald E. Knuth,et al.  Literate Programming , 1984, Comput. J..

[16]  E. Burton Swanson,et al.  The dimensions of maintenance , 1976, ICSE '76.

[17]  Simon J. Thompson,et al.  Mechanical verification of refactorings , 2008, PEPM '08.

[18]  Huiqing Li,et al.  Formalisation of Haskell refactorings , 2005, Trends in Functional Programming.

[19]  Christopher Mark Brown,et al.  Tool support for refactoring Haskell programs , 2008 .

[20]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[21]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[22]  William G. Griswold,et al.  Automated assistance for program restructuring , 1993, TSEM.

[23]  Huiqing Li,et al.  Tool support for refactoring functional programs , 2003, Haskell '03.

[24]  Diomidis Spinellis,et al.  CScout: A refactoring browser for C , 2010, Sci. Comput. Program..

[25]  Michele Tepper,et al.  Web sites , 2008, NTWK.