An Investigation of the Laws of Traversals

Traversals of data structures are ubiquitous in programming. Consequently, it is important to be able to characterise those structures that are traversable and understand their algebraic properties. Traversable functors have been characterised by McBride and Paterson as those equipped with a distrib...

Full description

Bibliographic Details
Main Authors: Mauro Jaskelioff, Ondrej Rypacek
Format: Article
Language:English
Published: Open Publishing Association 2012-02-01
Series:Electronic Proceedings in Theoretical Computer Science
Online Access:http://arxiv.org/pdf/1202.2919v1
id doaj-dbc15c4a28754c7f8ea2ca2f24581339
record_format Article
spelling doaj-dbc15c4a28754c7f8ea2ca2f245813392020-11-24T23:34:10ZengOpen Publishing AssociationElectronic Proceedings in Theoretical Computer Science2075-21802012-02-0176Proc. MSFP 2012404910.4204/EPTCS.76.5An Investigation of the Laws of TraversalsMauro JaskelioffOndrej RypacekTraversals of data structures are ubiquitous in programming. Consequently, it is important to be able to characterise those structures that are traversable and understand their algebraic properties. Traversable functors have been characterised by McBride and Paterson as those equipped with a distributive law over arbitrary applicative functors; however, laws that fully capture the intuition behind traversals are missing. This article is an attempt to remedy this situation by proposing laws for characterising traversals that capture the intuition behind them. To support our claims, we prove that finitary containers are traversable in our sense and argue that elements in a traversable structure are visited exactly once.http://arxiv.org/pdf/1202.2919v1
collection DOAJ
language English
format Article
sources DOAJ
author Mauro Jaskelioff
Ondrej Rypacek
spellingShingle Mauro Jaskelioff
Ondrej Rypacek
An Investigation of the Laws of Traversals
Electronic Proceedings in Theoretical Computer Science
author_facet Mauro Jaskelioff
Ondrej Rypacek
author_sort Mauro Jaskelioff
title An Investigation of the Laws of Traversals
title_short An Investigation of the Laws of Traversals
title_full An Investigation of the Laws of Traversals
title_fullStr An Investigation of the Laws of Traversals
title_full_unstemmed An Investigation of the Laws of Traversals
title_sort investigation of the laws of traversals
publisher Open Publishing Association
series Electronic Proceedings in Theoretical Computer Science
issn 2075-2180
publishDate 2012-02-01
description Traversals of data structures are ubiquitous in programming. Consequently, it is important to be able to characterise those structures that are traversable and understand their algebraic properties. Traversable functors have been characterised by McBride and Paterson as those equipped with a distributive law over arbitrary applicative functors; however, laws that fully capture the intuition behind traversals are missing. This article is an attempt to remedy this situation by proposing laws for characterising traversals that capture the intuition behind them. To support our claims, we prove that finitary containers are traversable in our sense and argue that elements in a traversable structure are visited exactly once.
url http://arxiv.org/pdf/1202.2919v1
work_keys_str_mv AT maurojaskelioff aninvestigationofthelawsoftraversals
AT ondrejrypacek aninvestigationofthelawsoftraversals
AT maurojaskelioff investigationofthelawsoftraversals
AT ondrejrypacek investigationofthelawsoftraversals
_version_ 1725529281749057536