Generic unification via two-level types and parameterized modules

Authors
Citation
T. Sheard, Generic unification via two-level types and parameterized modules, ACM SIGPL N, 36(10), 2001, pp. 86-97
Citations number
13
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
36
Issue
10
Year of publication
2001
Pages
86 - 97
Database
ISI
SICI code
1523-2867(200110)36:10<86:GUVTTA>2.0.ZU;2-M
Abstract
As a functional pearl, we describe an efficient, modularized implementation of unification using the state of mutable reference cells to encode substi tutions. We abstract our algorithms along two dimensions, first abstracting away from the structure of the terms to be unified, and second over the mo nad in which the mutable state is encapsulated. We choose this example to illustrate two important techniques that we belie ve many functional programmers would find useful. The first of these is the definition of recursive data types using two levels: a structure defining level, and a recursive knot-tying level. The second is the use of rank-2 po lymorphism inside Haskell's record types to implement a form of type parame terized modules.