Publication View

The essence of the Iterator pattern (2006)

Abstract
The ITERATOR pattern gives a clean interface for element-by-element access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that McBride and Paterson’s idioms, and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the ITERATOR pattern. We present some axioms for traversal, and illustrate with a simple example, the repmin problem.

Publication details
Download http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.95.5790
Source http://www.bcs.org/upload/pdf/ewic_ms06_paper7.pdf
Contributors CiteSeerX
Repository CiteSeerX - Scientific Literature Digital Library and Search Engine (United States)
Keywords Iterator, Traversal, Design Pattern, Map, Fold, Monad, Idiom
Type text
Language English
Relation 10.1.1.30.20, 10.1.1.36.272, 10.1.1.71.463, 10.1.1.42.6862, 10.1.1.19.2886, 10.1.1.57.9853, 10.1.1.24.5099, 10.1.1.53.3718, 10.1.1.103.6073, 10.1.1.60.5251, 10.1.1.108.2008, 10.1.1.108.8788, 10.1.1.118.1826