Abstract
Efficient type inference algorithms are based on graph-rewriting techniques. Consequently, at first sight they seem unsuitable for functional language implementation. In fact, most compilers written in functional languages use substitution-based algorithms, at a considerable cost in performance. In this paper, we show how monads may be used to transform a substitution-based inference algorithm into one using a graph representation. The resulting algorithm is faster than the corresponding substitution-based algorithm.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Aho A, Sethi R, Ullman J. Compilers: Principles, Techniques, and Tools, Addison Wesley, 1986.
Damas L, Milner R. “Principal type schemes for functional programs”, Proc. 9th ACM POPL, Albuquerque, NM, 1982, pp 207–212.
Hammond K, Parallel SML: A Functional Language and its Implementation in Dactl, Pitman Research Monographs in Parallel and Distributed Computing, Pitman Press, 1991.
Henglein F. “Type Inference with Polymorphic Recursion”, To appear in ACM TOPLAS, 1992.
Hudak P, Bloss A. “The Aggregate Update Problem in Functional Programming Systems”, Proc. 12th. ACM POPL, 1985, pp 300–314.
Hudak P, Wadler PL (Eds.). “Report on the Programming Language Haskell, Version 1.0”, Technical Report of the Universities of Glasgow and Yale, 1990.
Kfoury AJ, Tiuryn J, Urzyczyn P. “ML Typability is DEXPTIME-Complete”, Proc. CAAP 90, Springer Verlag LN, 1990, pp 206–220.
Mairson HG. “Deciding ML Typability is Complete for Deterministic Exponential Time”, Proc. 17th. ACM POPL, 1990, pp 382–401.
Martelli A, Montanari U. “An Efficient Unification Algorithm”, TOPLAS, 4 (2): 258–282, April 1982.
Milner RJ. “A Theory of Type Polymorphism in Programming”, J Comp Sys Sci, 17: 348–75, 1978.
Moggi E. “Computational Lambda-Calculus and Monads”. In Symp. Logic in Comp. Sci., 1989.
Moggi E. “The Mathematical Structure of Programming Languages”, unpublished report, University di Genova, May 1991.
Paterson M. Wegman M. “Linear Unification”, J. Comp. Sys. Sci., 16: 158–167, 1978.
Wadler PL. “Comprehending Monads”, In Proc. Lisp & FP 90, Nice, 1990.
Wadler PL, “The Essence of Functional Programming”, Proc. 18th. ACM POPL, 1992.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1992 British Computer Society
About this paper
Cite this paper
Hammond, K. (1992). Efficient Type Inference Using Monads (Summary). In: Heldal, R., Holst, C.K., Wadler, P. (eds) Functional Programming, Glasgow 1991. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3196-0_12
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3196-0_12
Publisher Name: Springer, London
Print ISBN: 978-3-540-19760-7
Online ISBN: 978-1-4471-3196-0
eBook Packages: Springer Book Archive