@inproceedings{512cfaa311004d4385a4a17f71802881,
title = "Backtracking iterators",
abstract = "Iterating over the elements of an abstract collection is usually done in ML using a fold-like higher-order function provided by the data structure. This article discusses a different paradigm of iteration based on purely functional, immutable cursors. Contrary to fold-like iterators, the iteration can be cleanly interrupted at any step. Contrary to imperative cursors (such as those found in C++ and Java libraries) it is possible to backtrack the iterator to a previous step. Several ways to iterate over binary trees are examined and close links with G{\'e}rard Huet's Zipper are established. Incidentally, we show the well-known two-lists implementation of functional queues arising from a Zipper-based breadth-first traversal.",
keywords = "Backtracking, Iteration, Persistent data structures",
author = "Filli{\^a}tre, \{Jean Christophe\}",
year = "2006",
month = sep,
day = "16",
doi = "10.1145/1159876.1159885",
language = "English",
isbn = "1595934839",
series = "Proceedings of the ACM SIGPLAN 2006 Workshop on ML",
publisher = "Association for Computing Machinery (ACM)",
pages = "54--62",
booktitle = "Proceedings of the ACM SIGPLAN 2006 Workshop on ML",
note = "2006 ACM SIGPLAN Workshop on ML, ML 2006 ; Conference date: 16-09-2006 Through 16-09-2006",
}