Title of article :
Refactoring pattern matching
Author/Authors :
Meng Wang، نويسنده , , Jeremy Gibbons، نويسنده , , Kazutaka Matsuda، نويسنده , , Zhenjiang Hu، نويسنده ,
Issue Information :
ماهنامه با شماره پیاپی سال 2013
Pages :
27
From page :
2216
To page :
2242
Abstract :
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.
Keywords :
Functional Programming , Pattern matching , Invertible programming , Abstract datatypes , Fusion , Refactoring
Journal title :
Science of Computer Programming
Serial Year :
2013
Journal title :
Science of Computer Programming
Record number :
1080432
Link To Document :
بازگشت