There and back again: arrows for invertible programming

Invertible programming occurs in the area of data conversion where it is required that the conversion in one direction is the inverse of the other. For that purpose, we introduce bidirectional arrows (bi-arrows). The bi-arrow class is an extension of Haskell's arrow class with an extra combinator that changes the direction of computation.The advantage of the use of bi-arrows for invertible programming is the preservation of invertibility properties using the bi-arrow combinators. Programming with bi-arrows in a polytypic or generic way exploits this the most. Besides bidirectional polytypic examples, including invertible serialization, we give the definition of a monadic bi-arrow transformer, which we use to construct a bidirectional parser/pretty printer.

[1]  Johan Jeuring,et al.  Dependency-style generic haskell , 2003, ACM SIGPLAN Notices.

[2]  Brian J. Ross,et al.  Running programs backwards: The logical inversion of imperative computation , 1997, Formal Aspects of Computing.

[3]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..

[4]  Philip Wadler Monads for Functional Programming , 1995, Advanced Functional Programming.

[5]  Simon L. Peyton Jones,et al.  Derivable Type Classes , 2001, Haskell.

[6]  Paul Hudak,et al.  A gentle introduction to Haskell , 1992, SIGP.

[7]  Johan Jeuring,et al.  Polytypic Compact Printing and Parsing , 1999, ESOP.

[8]  Edsger W. Dijkstra,et al.  Program Inversion , 1978, Program Construction.

[9]  Antony Courtney,et al.  Genuinely Functional User Interfaces , 2001 .

[10]  S-C. Mu,et al.  An algebraic approach to bidirectional updating , 2004 .

[11]  Paul Hudak,et al.  Arrows, Robots, and Functional Reactive Programming , 2002, Advanced Functional Programming.

[12]  Marinus J. Plasmeijer,et al.  A Generic Programming Extension for Clean , 2001, IFL.

[13]  Ross Paterson,et al.  A new notation for arrows , 2001, ICFP '01.

[14]  Rinus Plasmeijer,et al.  Concurrent Clean Language Report - version 1.3 , 1998 .

[15]  Robert Glück,et al.  Derivation of Deterministic Inverse Programs Based on LR Parsing , 2004, FLOPS.

[16]  Wei Chen,et al.  Program Inversion: More than Fun! , 1990, Sci. Comput. Program..

[17]  John Hughes,et al.  Report on the Programming Language Haskell 98 , 1999 .

[18]  Johan Jeuring,et al.  Polytypic data conversion programs , 2002, Sci. Comput. Program..

[19]  Robert Glück,et al.  Revisiting an automatic program inverter for Lisp , 2005, SIGP.