Skip to main content
Kent Academic Repository

“Bidirectionalization for Free” for Monomorphic Transformations

Matsuda, Kazutaka, Wang, Meng (2014) “Bidirectionalization for Free” for Monomorphic Transformations. Science of Computer Programming, 111 (Part 1). pp. 79-109. ISSN 0167-6423. (doi:10.1016/j.scico.2014.07.008) (Access to this publication is currently restricted. You may be able to access a copy if URLs are provided) (KAR id:47485)

PDF
Language: English

Restricted to Repository staff only
[thumbnail of scp14.pdf]
Official URL:
http://dx.doi.org/10.1016/j.scico.2014.07.008

Abstract

Abstract A bidirectional transformation is a pair of mappings between source and view data objects, one in each direction. When the view is modified, the source is updated accordingly with respect to some laws. Over the years, a lot of effort has been made to offer better language support for programming such transformations. In particular, a technique known as bidirectionalization is able to analyze and transform unidirectional programs written in general purpose languages, and “bidirectionalize” them. Among others, an approach termed semantic bidirectionalization proposed by Voigtländer stands out in terms of user-friendliness. A unidirectional program can be written using arbitrary language constructs, as long as the function it represents is polymorphic and the language constructs respect parametricity. The free theorems that follow from the polymorphic type of the program allow a kind of forensic examination of the transformation, determining its effect without examining its implementation. This is convenient, as the programmer is not restricted to using a particular syntax; but it does require the transformation to be polymorphic. In this paper, we lift this polymorphism requirement to improve the applicability of semantic bidirectionalization. Concretely, we provide a type class PackM ? ? ? , which intuitively reads “a concrete datatype ? is abstracted to a type ?, and the ‘observations’ made by a transformation on values of type ? are recorded by a monad ?”. With PackM, we turn monomorphic transformations into polymorphic ones that are ready to be bidirectionalized. We demonstrate our technique with case studies of typical applications of bidirectional transformation, namely text processing, \{XML\} query and graph transformation, which were commonly considered beyond semantic bidirectionalization because of their monomorphic nature.

Item Type: Article
DOI/Identification number: 10.1016/j.scico.2014.07.008
Uncontrolled keywords: Bidirectional transformation, Free theorem, Type class, Haskell
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,
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Depositing User: Meng Wang
Date Deposited: 01 Mar 2015 00:50 UTC
Last Modified: 17 Aug 2022 10:58 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/47485 (The current URI for this page, for reference purposes)

University of Kent Author Information

Wang, Meng.

Creator's ORCID:
CReDIT Contributor Roles:
  • Depositors only (login required):

Total unique views for this document in KAR since July 2020. For more details click on the image.