MetaCart Sign in to MyCiteSeerX

Include Citations | Advanced Search | Help

Disambiguated Search | Include Citations | Advanced Search | Help

The Web (Functional Pearl) (2001)

by Funct I Onal Pearl ,  Ralf Hinze ,  Johan Jeuring
Add To MetaCart

Abstract:

Introduction Say, you want to implement a structured editor for some term type, so that the user can navigate through a given term and perform edit actions on subterms. In this case you are immediately faced with the problem of how to keep track of the cursor movements and the user's edits in a reasonably ecient manner. In a previous pearl G. Huet (1997) introduced a simple data structure, the Zipper, that addresses this problem|we will explain the Zipper briey in Sec. 2. A drawback of the Zipper is that the type of cursor locations depends on the structure of the term type, that is, each term type gives rise to a dierent type of locations (unless you are working in an untyped environment). In this pearl we present an alternative data structure, the Web, that serves the same purpose but that is parametric in the underlying term type. Sec. 3 - 6 are devoted to the new data structure. Before we unravel the Zipper and explore the Web, let us rst

Citations

7 Hugs 98 User Manual. Available from http://www.haskell.org/hugs – Jones, Peterson - 1999
5 Functional Pearl: The Zipper – Huet - 1997