CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Refactoring Pattern Matching

Meng Wang (Institutionen för data- och informationsteknik, Software Engineering (Chalmers)) ; Jeremy Gibbons ; Kazutaka Matsuda ; Zhenjiang Hu
Science of Computer Programming (0167-6423). Vol. 78 (2013), 11, p. 2216-2242.
[Artikel, refereegranskad vetenskaplig]

Defining functions by pattern matching over the arguments is advantageous for understanding and reasoning, but it tends to expose the implementation of a datatype. Significant effort has been invested in tackling this loss of modularity; however, decoupling patterns from concrete representations while maintaining soundness of reasoning has been a challenge. Inspired by the development of invertible programming, we propose an approach to program refactoring based on a right-invertible language RINV -- every function has a right (or pre-) inverse. We show how this new design is able to permit a smooth incremental transition from programs with algebraic datatypes and pattern matching, to ones with proper encapsulation, while maintaining simple and sound reasoning.

Nyckelord: functional programming, refactoring, pattern matching, invertible programming, abstract datatypes, fusion

Den här publikationen ingår i följande styrkeområden:

Läs mer om Chalmers styrkeområden  

Denna post skapades 2012-03-23. Senast ändrad 2013-10-28.
CPL Pubid: 156134


Läs direkt!

Lokal fulltext (fritt tillgänglig)

Länk till annan sajt (kan kräva inloggning)