Patrik Jansson - Johan Jeuring
During the last few years we have used PolyP to construct a number of
polytypic programs, for example for unification, parsing, rewriting,
pattern matching, etc. These polytypic programs use several basic
polytypic functions, such as the relatively well-known
map, but also less well-known functions such as
We have collected these basic polytypic functions in the library of
PolyP: PolyLib [10, app. B].
This paper describes the polytypic functions in PolyLib, motivates
their presence in the library, and gives a rationale for their design.
Thus we hope to share our experience with other researchers in the
field. We will assume the reader has some familiarity with the field
of polytypic programming.
Of course, a library is an important part of a programming language. Languages like Java, Delphi, Perl and Haskell are popular partly because of their useful and extensive libraries. For a polytypic programming language it is even more important to have a clear and well-designed library: writing polytypic programs is difficult, and we do not expect many programmers to write polytypic programs. On the other hand, many programmers use polytypic programs such as parser generators, equality functions, etc.
This is a first attempt to describe the library of PolyP; we expect that both the form and content of this description will change over time. One of the goals of this paper is to obtain feedback on the library design from other researchers working within the field. At the moment the library only contains the basic polytypic functions. In the future we will develop special purpose sublibraries for polytypic functions with more advanced functionality, for example for parsing and the other programs mentioned above.