Wang, Meng, Gibbons, Jeremy, Matsuda, Kazutaka, Hu, Zhenjiang (2013) Refactoring pattern matching. Science of Computer Programming, 78 (11). pp. 2216-2242. ISSN 0167-6423. (doi:10.1016/j.scico.2012.07.014) (KAR id:47478)
|
PDF
Author's Accepted Manuscript
Language: English |
|
|
Download this file (PDF/238kB) |
Preview |
| Request a format suitable for use with assistive technology e.g. a screenreader | |
| Official URL: http://www.sciencedirect.com/science/article/pii/S... |
|
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.
| Item Type: | Article |
|---|---|
| DOI/Identification number: | 10.1016/j.scico.2012.07.014 |
| Uncontrolled keywords: | Functional programming; Refactoring; Pattern matching; Invertible programming; Abstract datatypes; Fusion |
| Subjects: |
Q Science > QA Mathematics (inc Computing science) > QA 75 Electronic computers. Computer science Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming, |
| Institutional Unit: | Schools > School of Computing |
| Former Institutional Unit: |
Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
|
| Depositing User: | Meng Wang |
| Date Deposited: | 01 Mar 2015 00:18 UTC |
| Last Modified: | 20 May 2025 10:15 UTC |
| Resource URI: | https://kar.kent.ac.uk/id/eprint/47478 (The current URI for this page, for reference purposes) |
- Link to SensusAccess
- Export to:
- RefWorks
- EPrints3 XML
- BibTeX
- CSV
- Depositors only (login required):

Altmetric
Altmetric