Explicit Binds: Effortless Efficiency with and without Trees

  • Tarmo Uustalu
Conference paper

DOI: 10.1007/978-3-642-29822-6_25

Part of the Lecture Notes in Computer Science book series (LNCS, volume 7294)
Cite this paper as:
Uustalu T. (2012) Explicit Binds: Effortless Efficiency with and without Trees. In: Schrijvers T., Thiemann P. (eds) Functional and Logic Programming. FLOPS 2012. Lecture Notes in Computer Science, vol 7294. Springer, Berlin, Heidelberg

Abstract

We demonstrate a simple and robust program transformation technique that can improve asymptotic time complexity of data-manipulating programs (e.g., produce a linear-time list reversal function from the obvious quadratic one). In the version of the present paper, it applies to monadic inductive datatypes and can be stated in two flavors, through a datatype representation, with an explicit (“frozen”) bind constructor and a special associated defining clause for the fold function, and in a functional form (generalized Church numerals), with a special definition of the bind function in terms of the build constructor. The technique explicates, systematizes, combines and scales a number of ideas known from the literature, achieving a new level of generality.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Tarmo Uustalu
    • 1
  1. 1.Institute of CyberneticsTallinn University of TechnologyTallinnEstonia

Personalised recommendations