Recursion patterns and time-analysis

This paper explores some ideas concerning the time-analysis of functional programs defined by instantiating typical recursion patterns such as folds, unfolds, and hylomorphisms. The concepts in this paper are illustrated through a rich set of examples in the Haskell programming language. We concentr...

ver descrição completa

Detalhes bibliográficos
Autor principal: Barbosa, Manuel (author)
Outros Autores: Cunha, Alcino (author), Pinto, Jorge Sousa (author)
Formato: article
Idioma:eng
Publicado em: 2005
Assuntos:
Texto completo:http://hdl.handle.net/1822/2762
País:Portugal
Oai:oai:repositorium.sdum.uminho.pt:1822/2762
Descrição
Resumo:This paper explores some ideas concerning the time-analysis of functional programs defined by instantiating typical recursion patterns such as folds, unfolds, and hylomorphisms. The concepts in this paper are illustrated through a rich set of examples in the Haskell programming language. We concentrate on unfolds and folds (also known as anamorphisms and catamorphisms respectively) of recursively defined types, as well as the more general hylomorphism pattern. For the latter, we use as case-studies two famous sorting algorithms, mergesort and quicksort. Even though time analysis is not compositional, we argue that splitting functions to expose the explicit construction of the recursion tree and its later consumption helps with this analysis.