Hostname: page-component-89b8bd64d-ktprf Total loading time: 0 Render date: 2026-05-08T04:36:57.231Z Has data issue: false hasContentIssue false

Functional Pearl

Back to basics: Deriving representation changers functionally

Published online by Cambridge University Press:  07 November 2008

Erik Meijer
Affiliation:
Department of Computer Science, University of Utrecht, PO Box 80.089, 3508 TB Utrecht, The Netherlands
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

A representation changer is a function that converts a concrete representation of an abstract value into a different concrete representation of that value. Many useful functions can be recognised as representation changers; examples include compilers and arithmetic functions such as addition and multiplication. Functions that can be specified as the right inverse of other functions are special cases of representation changers. In recent years, a number of authors have used a relational calculus to derive representation changers from their specifications. In this paper, we show that the generality of relations is not essential, and representation changers can be derived within the more basic setting of functional programming. We illustrate our point by deriving a carry-save adder and a base-converter, two functions which have previously been derived relationally.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1996
Submit a response

Discussions

No Discussions have been published for this article.