CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Polytypic Programming in Haskell

Ulf Norell (Institutionen för datavetenskap, Funktionell programmering) ; Patrik Jansson (Institutionen för datavetenskap, Funktionell programmering ; Institutionen för datavetenskap, Programmeringslogik)
Implementation of Functional Languages Vol. LNCS (2004), 3145, p. 168-184.
[Konferensbidrag, refereegranskat]

A polytypic (or generic) program captures a common pattern of computation over different datatypes by abstracting over the structure of the datatype. Examples of algorithms that can be defined polytypically are equality tests, mapping functions and pretty printers. A commonly used technique to implement polytypic programming is specialization, where a specialized version of a polytypic function is generated for every datatype it is used at. In this paper we describe an alternative technique that allows polytypic functions to be defined using Haskell's class system (extended with multi-parameter type classes and functional dependencies). This technique brings the power of polytypic programming inside Haskell allowing us to define a Haskell library of polytypic functions. It also increases our flexibility, reducing the dependency on a polytypic language compiler. Valid HTML 4.01!

Denna post skapades 2006-10-09. Senast ändrad 2014-09-02.
CPL Pubid: 10129


Läs direkt!

Länk till annan sajt (kan kräva inloggning)

Institutioner (Chalmers)

Institutionen för datavetenskap, Funktionell programmering (2002-2004)
Institutionen för datavetenskap, Programmeringslogik (2002-2004)


Teoretisk datalogi

Chalmers infrastruktur