Functional Polytypic Programming --- Use and Implementation
Licentiate thesis, 1997

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 different datatypes. Examples of such functions are pretty printers, pattern matchers, equality functions, unifiers, rewriting functions, etc. Such functions are called polytypic functions. A polytypic function is a function that is defined by induction on the structure of user-defined datatypes. This thesis introduces polytypic functions, shows how to construct and reason about polytypic functions and describes the implementation of the polytypic programming system PolyP. PolyP extends a functional language (a subset of Haskell) with a construct for writing polytypic functions. The extended language type checks definitions of polytypic functions, and infers the types of all other expressions. Programs in the extended language are translated to Haskell.

Algebraic datatypes

Programming languages

Functional programming

Polytypic programming

Generic programming


Patrik Jansson

Programming Logic

Functional Programming

PolyP - a polytypic programming language extension

Principles of Programming Languages,; Vol. POPL97(1997)p. 470-482

Paper in proceeding

Functional Pearl: Polytypic Unification

Journal of Functional Programming,; Vol. 8(1998)p. 527-536

Journal article

Polytypic Programming

Advanced Functional Programming,; (1996)p. 68-114

Book chapter

Subject Categories

Computer Science



Technical report - Department of Computing Science, Chalmers University of Technology and Göteborg University

More information