The Essence of the Iterator Pattern
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 functional iterations model one or other of these, but not both simultaneously. We argue that McBride a...
Những tác giả chính: | , |
---|---|
Định dạng: | Conference item |
Được phát hành: |
2006
|
_version_ | 1826280745970171904 |
---|---|
author | Gibbons, J Oliveira, B |
author_facet | Gibbons, J Oliveira, B |
author_sort | Gibbons, J |
collection | OXFORD |
description | 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 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. |
first_indexed | 2024-03-07T00:18:19Z |
format | Conference item |
id | oxford-uuid:7b9f62c5-776c-4f3f-a7f7-58cf4eed36f9 |
institution | University of Oxford |
last_indexed | 2024-03-07T00:18:19Z |
publishDate | 2006 |
record_format | dspace |
spelling | oxford-uuid:7b9f62c5-776c-4f3f-a7f7-58cf4eed36f92022-03-26T20:51:53ZThe Essence of the Iterator PatternConference itemhttp://purl.org/coar/resource_type/c_5794uuid:7b9f62c5-776c-4f3f-a7f7-58cf4eed36f9Department of Computer Science2006Gibbons, JOliveira, BThe 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 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. |
spellingShingle | Gibbons, J Oliveira, B The Essence of the Iterator Pattern |
title | The Essence of the Iterator Pattern |
title_full | The Essence of the Iterator Pattern |
title_fullStr | The Essence of the Iterator Pattern |
title_full_unstemmed | The Essence of the Iterator Pattern |
title_short | The Essence of the Iterator Pattern |
title_sort | essence of the iterator pattern |
work_keys_str_mv | AT gibbonsj theessenceoftheiteratorpattern AT oliveirab theessenceoftheiteratorpattern AT gibbonsj essenceoftheiteratorpattern AT oliveirab essenceoftheiteratorpattern |