Results 1 
3 of
3
Generic Programming With Relations and Functors
 Journal of Functional Programming
, 1999
"... This paper explores the idea of generic programming in which programs are parameterised by data types. Part of the constructive theory of lists, specically the part dealing with properties of segments, is generalised in two ways: from lists to arbitrary inductive data types, and from functions to ..."
Abstract

Cited by 9 (6 self)
 Add to MetaCart
This paper explores the idea of generic programming in which programs are parameterised by data types. Part of the constructive theory of lists, specically the part dealing with properties of segments, is generalised in two ways: from lists to arbitrary inductive data types, and from functions to relations. The new theory is used to solve a generic problem about segments. 1 Introduction To what extent is it possible to construct programs without knowing exactly what data types are involved? At rst sight this may seem a strange question, but consider the case of pattern matching. Over lists, this problem can be formulated in terms of two strings, a pattern and a text; the object is to determine if and where the pattern occurs as a segment of the text. Now, pattern matching can be generalised to other data types, including arrays and trees of various kinds; the essential step is to be able to dene the notion of `segment' in these types. So the intriguing question arises: can one...
Drawing Trees
"... This article describes the application of functional programming techniques to a problem previously studied by imperative programmers, that of drawing general trees automatically. We first consider the nature of the problem and the ideas behind its solution (due to Radack), independent of programmin ..."
Abstract

Cited by 8 (0 self)
 Add to MetaCart
This article describes the application of functional programming techniques to a problem previously studied by imperative programmers, that of drawing general trees automatically. We first consider the nature of the problem and the ideas behind its solution (due to Radack), independent of programming language implementation. We then describe a Standard ML program which reflects the structure of the abstract solution much better than an imperative language implementation. We conclude with an informal discussion on the correctness of the implementation and some changes which improve the algorithm's worstcase time complexity. 1 The problem and its solution The problem is this: given a labelled tree, assign to each node a position on the page to give an aesthetically pleasing rendering of the tree. We assume that nodes at the same depth are positioned on the same horizontal line on the page, so the problem reduces to finding a position horizontally for each node. But what do we mean by "...
Functional pearls: Drawing trees
 Journal of Functional Programming
, 1995
"... This article describes the application of functional programming techniques to a problem previously studied by imperative programmers, that of drawing general trees automatically. We first consider the nature of the problem and the ideas behind its solution (due to Radack), independent of programmin ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
This article describes the application of functional programming techniques to a problem previously studied by imperative programmers, that of drawing general trees automatically. We first consider the nature of the problem and the ideas behind its solution (due to Radack), independent of programming language implementation. We then describe a Standard ML program which reflects the structure of the abstract solution much better than an imperative language implementation. We conclude with an informal discussion on the correctness of the implementation and some changes which improve the algorithm’s worstcase time complexity. 1 The problem and its solution The problem is this: given a labelled tree, assign to each node a position on the page to give an aesthetically pleasing rendering of the tree. We assume that nodes at the same depth are positioned on the same horizontal line on the page, so the problem reduces to finding a position horizontally for each node. But what do we mean by “aesthetically pleasing”? The various papers on the subject (Radack, 1988;