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

Bidirectionalization for Free with Runtime Recording: Or, a Light-Weight Approach to the View-Update Problem

Kazutaka Matsuda ; Meng Wang (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers))
Proceedings of the 15th Symposium on Principles and Practice of Declarative Programming, PPDP 2013 p. 297-308. (2013)
[Konferensbidrag, refereegranskat]

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 \emph{bidirectionalization} is able to analyze and transform unidirectional programs written in general purpose languages, and "bidirectionalize" them. Among others, a technique termed as semantic bidirectionalization proposed by Voigtländer stands out in term of user-friendliness. The unidirectional program can be written using arbitrary language constructs, as long as the function 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, in the sense that 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 polymorphic requirement to improve the applicability of semantic bidirectionalization. Concretely, we provide a type class PackM; intuitively "PackM c a m'' reads "a concrete datatype c is abstracted to a type a, and the 'observations' made by a transformation on values of type c are recorded by a monad m''. With PackM, we turn monomorphic transformations into polymorphic ones, ready to be bidirectionalized. We demonstrate our technique with a case study of standard XML queries, which were considered beyond semantic bidirectionalization because of their monomorphic nature.

Nyckelord: Bidirectional Transformation, Free Theorem, Type Class, Haskell, XML Transformation

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

Läs mer om Chalmers styrkeområden  

Denna post skapades 2013-08-07. Senast ändrad 2016-07-05.
CPL Pubid: 180809


Läs direkt!

Lokal fulltext (fritt tillgänglig)

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