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...

Full description

Bibliographic Details
Main Author: Barbosa, Manuel (author)
Other Authors: Cunha, Alcino (author), Pinto, Jorge Sousa (author)
Format: article
Language:eng
Published: 2005
Subjects:
Online Access:http://hdl.handle.net/1822/2762
Country:Portugal
Oai:oai:repositorium.sdum.uminho.pt:1822/2762
Description
Summary: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.