## Program Optimisation, Naturally

Citations: | 7 - 2 self |

### BibTeX

@MISC{Bird_programoptimisation,,

author = {Richard Bird and Jeremy Gibbons and Geraint Jones},

title = {Program Optimisation, Naturally},

year = {}

}

### OpenURL

### Abstract

this paper we derive another, quite di#erent, linear-time algorithm for reversing a list. The derivation relies on a higherorder naturality [5] property of the function unzip, the function that turns a list of pairs into a pair of lists in the obvious way. The final program uses

### Citations

329 | Theorems for free
- Wadler
- 1989
(Show Context)
Citation Context ...since unzip does not inspect the elements of the input list, one can change these elements systematically either before or after unzipping the list, with exactly the same result in both cases. Wadler =-=[10-=-] has shown that every polymorphic function satises a naturality law whose form is deducible simply from its type. In the general case there are certain strictness conditions on the function f , altho... |

131 |
An algorithm for the machine computation of the complex fourier series
- Cooley, Tukey
- 1965
(Show Context)
Citation Context ... the least signicant bit, the latter on the most signicant. Assuming the denitions of rie and unrie, the algorithm is rev 0 = id rev k+1 = rie �� swap �� pair rev k �� unrie For example, r=-=ev 3 [0; 1; 2; 3; 4; 5-=-; 6; 7] = n denition of rev o rie (swap (pair rev 2 (unrie [0; 1; 2; 3; 4; 5; 6; 7]))) = n denition of unrie o rie (swap (pair rev 2 ([0; 2; 4; 6]; [1; 3; 5; 7]))) = n induction o rie (swap ([6; 4; 2;... |

93 | Polymorphic type schemes and recursive definitions - Mycroft - 1984 |

79 | Nested datatypes
- BIRD, MEERTENS
- 1998
(Show Context)
Citation Context ...y of the function unzip, which turns a list of pairs into a pair of lists in the obvious way. Thesnal program uses polymorphic recursion [8], and can be expressed rather neatly using nested datatypes =-=[1]-=-. Although neither feature is an essential component of the fast algorithm, they do simplify it, providing more evidence of the practical utility of these two concepts. Hinze [3] presents another appl... |

59 | Powerlist: A structure for parallel recursion
- Misra
- 1994
(Show Context)
Citation Context ... the observation that the reverse of the concatenation of two lists is the concatenation, in the opposite order, of their reverses. For simplicity in what follows, we restrict attention to powerlists =-=[7-=-], a powerlist being a list with length a power of two. Then the function rev k , which reverses a list of length 2 k , is dened inductively by rev 0 [a] = [a] rev k+1 (x ++ y) = rev k y ++ rev k x It... |

25 |
A Generic Theory of Datatypes
- Hoogendijk
- 1997
(Show Context)
Citation Context ...inear-time algorithm by using an accumulating parameter. In this paper we derive another, quite dierent linear-time algorithm for reversing a list. The derivation relies on a higher-order naturality [=-=4]-=- property of the function unzip, which turns a list of pairs into a pair of lists in the obvious way. Thesnal program uses polymorphic recursion [8], and can be expressed rather neatly using nested da... |

10 |
Polymorphic type schemes and recursive de
- Mycroft
- 1984
(Show Context)
Citation Context ... The derivation relies on a higher-order naturality [4] property of the function unzip, which turns a list of pairs into a pair of lists in the obvious way. Thesnal program uses polymorphic recursion =-=[8]-=-, and can be expressed rather neatly using nested datatypes [1]. Although neither feature is an essential component of the fast algorithm, they do simplify it, providing more evidence of the practical... |

9 | Deriving the fast Fourier algorithm by calculation
- Jones
- 1989
(Show Context)
Citation Context ... the least signicant bit, the latter on the most signicant. Assuming the denitions of rie and unrie, the algorithm is rev 0 = id rev k+1 = rie �� swap �� pair rev k �� unrie For example, r=-=ev 3 [0; 1; 2; 3; 4; 5-=-; 6; 7] = n denition of rev o rie (swap (pair rev 2 (unrie [0; 1; 2; 3; 4; 5; 6; 7]))) = n denition of unrie o rie (swap (pair rev 2 ([0; 2; 4; 6]; [1; 3; 5; 7]))) = n induction o rie (swap ([6; 4; 2;... |

5 | A Classical Mind: Essays in Honour of - Roscoe - 1994 |

4 | Oege De Moor. More haste, less speed: lazy versus eager evaluation - Bird, Jones - 1997 |

2 |
Fast Fourier transform free from tears
- Macnaghten, Hoare
- 1977
(Show Context)
Citation Context ... the least signicant bit, the latter on the most signicant. Assuming the denitions of rie and unrie, the algorithm is rev 0 = id rev k+1 = rie �� swap �� pair rev k �� unrie For example, r=-=ev 3 [0; 1; 2; 3; 4; 5-=-; 6; 7] = n denition of rev o rie (swap (pair rev 2 (unrie [0; 1; 2; 3; 4; 5; 6; 7]))) = n denition of unrie o rie (swap (pair rev 2 ([0; 2; 4; 6]; [1; 3; 5; 7]))) = n induction o rie (swap ([6; 4; 2;... |

1 |
Perfect trees and bit-reversal permutations. Universitat
- Hinze
- 1999
(Show Context)
Citation Context ...sing nested datatypes [1]. Although neither feature is an essential component of the fast algorithm, they do simplify it, providing more evidence of the practical utility of these two concepts. Hinze =-=[3]-=- presents another application of these techniques to the problem of computing the bit-reversal permutation of a list. We describe this problem and its solution brie y in Section 6. Indeed, it was Hinz... |

1 | Perfect trees and bit-reversal permutations. Journal of Functional Programming, Accepted for publication - Hinze - 1999 |

1 | Generating functions of interconnection networks - Misra |