Polytypic Programming

Many functions have to be written over and over again for different datatypes, either because datatypes change during the development of programs, or because functions with similar functionality are needed on diierent datatypes. Examples of such functions are pretty printers, debug-gers, equality functions, uniiers, pattern matchers, rewriting functions, etc. Such functions are called polytypic functions. A polytypic function is a function that is deened by induction on the structure of user-deened datatypes. This paper introduces polytypic functions, and shows how to construct and reason about polytypic functions. A larger example is studied in detail: poly-typic functions for term rewriting and for determining whether a collection of rewrite rules is normalising.

[1]  C. Barry Jay,et al.  A Semantics for Shape , 1995, Sci. Comput. Program..

[2]  Peter J. Freyd,et al.  Recursive types reduced to inductive types , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[3]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[4]  Patrik Jansson Polytypism and polytypic unification , 1995 .

[5]  Johan Jeuring Algorithms for Theorems , 1990, Programming Concepts and Methods.

[6]  Tim Sheard,et al.  Automatic generation and use of abstract structure operators , 1991, TOPL.

[7]  Johan Jeuring,et al.  Merging Monads and Folds for Functional Programming , 1995, Advanced Functional Programming.

[8]  Karl Fritz Ruehr,et al.  Analytical and structural polymorphism expressed using patterns over types , 1992 .

[9]  Jens Palsberg,et al.  Efficient implementation of adaptive software , 1995, TOPL.

[10]  Karl J. Lieberherr,et al.  Adaptive object-oriented programming using graph-based customization , 1994, CACM.

[11]  Johan Jeuring Polytypic pattern matching , 1995, FPCA '95.

[12]  Corrado Böhm,et al.  Automatic Synthesis of Typed Lambda-Programs on Term Algebras , 1985, Theor. Comput. Sci..

[13]  I. Stark,et al.  Domains and Denotational Semantics History Accomplishments and Open Problems , 1996 .

[14]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[15]  Kevin Knight,et al.  Unification: a multidisciplinary survey , 1989, CSUR.

[16]  C. Xiao Eecient Implementation of Adaptive Software , 1994 .

[17]  Mark P. Jones,et al.  Functional Programming with Overloading and Higher-Order Polymorphism , 1995, Advanced Functional Programming.

[18]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[19]  Richard S. Bird,et al.  An introduction to the theory of lists , 1987 .

[20]  Akihiko Takano,et al.  Shortcut deforestation in calculational form , 1995, FPCA '95.

[21]  Oege de Moor,et al.  Categories, relations and dynamic programming , 1994, Mathematical Structures in Computer Science.

[22]  Graham Hutton,et al.  Bananas in space: extending fold and unfold to exponential types , 1995, FPCA '95.

[23]  G. Malcolm,et al.  Data Structures and Program Transformation , 1990, Sci. Comput. Program..

[24]  Jan Willem Klop,et al.  Term Rewriting Systems: From Church-Rosser to Knuth-Bendix and Beyond , 1990, ICALP.

[25]  Tim Sheard,et al.  Type parametric programming , 1993 .

[26]  Tim Sheard,et al.  Revisiting catamorphisms over datatypes with embedded functions , 1995 .

[27]  Michael A. Arbib,et al.  Algebraic Approaches to Program Semantics , 1986, Texts and Monographs in Computer Science.

[28]  Tim Sheard,et al.  Revisiting catamorphisms over datatypes with embedded functions (or, programs from outer space) , 1996, POPL '96.

[29]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[30]  Maarten M. Fokkinga,et al.  Law and order in algorithmics , 1992 .

[31]  Simon L. Peyton Jones,et al.  SIGPLAN Notices Special Issue on the Functional Programming Language Haskell , 1992, ACM SIGPLAN Notices.

[32]  Richard S. Bird,et al.  Lectures on Constructive Functional Programming , 1989 .

[33]  Maarten M. Fokkinga,et al.  Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire , 1991, FPCA.

[34]  Tim Sheard,et al.  Type safe abstractions using program generators , 1995 .