Lecture 16: Bidirectional programming, continued

A revisited example in Boomerang which projects a view that removes the last field of an address-email-office list. Two issues with the basic lens constructs: (1) the records must be updated in the same order that they appear, and (2) there is no flexibility in layout, for example, the amount of whitespace. The first case is addressed with resourceful lenses and the second with quotient lenses. Ideas behind the semantics of each construct. For resourceful lenses, the idea of a skeleton and its resource content. For quotient lenses, the idea of equivalence relations and canonizers. Finally, in each case, the practical programming features which exploit them. Briefly, a third way for bidirectional programming was mentioned: probing the behaviour of the get function to automatically define a put function.

Homework

  • Try some more sophisticated examples in Boomerang.

Comments are closed.