| | |
Summary: Exploring the Regular Tree Types
Peter Morris, Thorsten Altenkirch and Conor McBride
School of Computer Science and Information Technology
University of Nottingham
Abstract. In this paper we use the Epigram language to define the
universe of regular tree types--closed under empty, unit, sum, product
and least fixpoint. We then present a generic decision procedure for Epi-
gram's in-built equality at each type, taking a complementary approach
to that of Benke, Dybjer and Jansson [7]. We also give a generic defini-
tion of map, taking our inspiration from Jansson and Jeuring [21]. Fi-
nally, we equip the regular universe with the partial derivative which can
be interpreted functionally as Huet's notion of `zipper', as suggested by
McBride in [27] and implemented (without the fixpoint case) in Generic
Haskell by Hinze, Jeuring and L¨oh [18]. We aim to show through these
examples that generic programming can be ordinary programming in a
dependently typed language.
1 Introduction
This paper is about generic programming [6] in the dependently typed functional
language Epigram [29, 30]. We construct the universe of regular tree types--the
datatypes closed under empty, unit, sum, product and least fixpoint--by giving
|