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.