Publication View

Under consideration for publication in J. Functional Programming 1 The Essence of the Iterator Pattern (2008)

Abstract
The ITERATOR pattern gives a clean interface for element-by-element access to a collection, independent of the collection’s shape. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional models of iteration capture one or other of these aspects, but not both simultaneously. We argue that McBride and Paterson’s applicative functors, and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the ITERATOR pattern. Moreover, they do so in a way that nicely supports modular programming. We present some axioms for traversal, discuss modularity concerns, and illustrate with a simple example, the wordcount problem. 1

Publication details
Download http://citeseerx.ist.psu.edu/viewdoc/summary?doi=?doi=10.1.1.108.2008
Source http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/iterator.pdf
Contributors CiteSeerX
Repository CiteSeerX - Scientific Literature Digital Library and Search Engine (United States)
Type text
Language English
Relation 10.1.1.83.8324, 10.1.1.41.840, 10.1.1.33.5381, 10.1.1.41.125, 10.1.1.100.8004, 10.1.1.39.1532, 10.1.1.30.20, 10.1.1.13.4313, 10.1.1.138.4552, 10.1.1.50.2961, 10.1.1.71.463, 10.1.1.53.3718, 10.1.1.1.8901, 10.1.1.100.22, 10.1.1.103.6073, 10.1.1.26.57, 10.1.1.51.4926, 10.1.1.103.7480