Weaving a web

Suppose, 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 efficient manner. In a previous pearl, Huet (1997) introduced a simple data structure, the Zipper, that addresses this problem – we will explain the Zipper briefly in section 2. A drawback of the Zipper is that the type of cursor locations depends on the structure of the term type, i.e. each term type gives rise to a different type of location (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. Sections 3–6 are devoted to the new data structure. Before we unravel the Zipper and explore the web, let us first give a taste of their use.

[1]  Paul Otlet Traité de documentation : le livre sur le livre, théorie et pratique , 1934 .

[2]  Vannevar Bush,et al.  As we may think , 1945, INTR.

[3]  Jean-François Lyotard,et al.  The Postmodern Condition , 1979 .

[4]  Thomas Hapke,et al.  Wilhelm Ostwald, the "Brücke" (Bridge), and connections to other bibliographic activities at the beginning of the twentieth century , 1999 .

[5]  Maurice Daumas Les machines à traduire de Georges Artsrouni , 1965 .

[6]  M. Foucault,et al.  The Order of Things , 2017 .

[7]  Paul Otlet Monde: essai d’universalisme: connaissance du monde, sentiment du monde, action organisée et plan du monde , 1970 .

[8]  Vienna . Österreichisches Gesellschafts und Wirtschaftsmuseum Gesellschaft und Wirtschaft, bildstatistisches Elementarwerk : das Gesellschafts- und Wirtschaftsmuseum in Wien zeigt in 100 Farbigen Bildtafeln : Produktionsformen, Gesellschaftsordnungen, Kulturstufen, Lebenshaltungen , 1930 .

[9]  P. Otlet International Organisation and Dissemination of Knowledge: Selected Essays of Paul Otlet , 1990 .

[10]  Gérard P. Huet,et al.  The Zipper , 1997, Journal of Functional Programming.

[11]  W. Boyd Rayward,et al.  Visions of Xanadu: Paul Otlet (1868-1944) and Hypertext , 1994, J. Am. Soc. Inf. Sci..

[12]  M. Buckland Emanuel Goldberg, electronic document retrieval, and Vannevar Bush's Memex , 1992 .

[13]  Mark Fischetti,et al.  Weaving the Web : the past and present and future of the World Wide Web by its inventor , 2000 .

[14]  John Hutchins Two precursors of machine translation : Artsrouni and Trojanskij , 2002 .

[15]  B. Massumi,et al.  The postmodern condition : a report on knowledge , 1979 .

[16]  W. B. Rayward,et al.  The Universe of Information: the Work of Paul Otlet for Documentation and International Organisation , 1975 .

[17]  Christopher May,et al.  THE INFORMATION SOCIETY AS MEGA-MACHINE , 2000 .

[18]  Frank G. Novak Lewis Mumford and Patrick Geddes: The Correspondence , 1971 .