Modular Polymorphic Defunctionalization

Georgios Fourtounis1, Nikolaos S. Papaspyrou1 and Panagiotis Theofilopoulos1

  1. School of Electrical and Computer Engineering, Software Engineering Laboratory
    National Technical University of Athens
    {gfour, nickie, ptheof}


Defunctionalization is generally considered a whole-program transformation and thus incompatible with separate compilation. In this paper, we formalize a modular variant of defunctionalization which can support separate compilation for a functional programming language with parametric polymorphism. Our technique allows modules in a Haskell-like language to be separately defunctionalized and compiled, then linked together to generate an executable program. We provide a prototype implementation of our modular defunctionalization technique and we discuss the experiences of its application in compiling a large subset of Haskell to low-level C code, based on the intensional transformation.

Key words

defunctionalization, separate compilation, polymorphism, Haskell

Digital Object Identifier (DOI)

Publication information

Volume 11, Issue 4 (October 2014)
Special Issue on Advances in Systems, Modeling, Languages and Agents
Year of Publication: 2014
ISSN: 1820-0214 (Print) 2406-1018 (Online)
Publisher: ComSIS Consortium

Full text

DownloadAvailable in PDF
Portable Document Format

How to cite

Fourtounis, G., Papaspyrou, N. S., Theofilopoulos, P.: Modular Polymorphic Defunctionalization. Computer Science and Information Systems, Vol. 11, No. 4, 1417–1434. (2014),