Abstract
The response of compilers to programs with type errors can be unpredictable and confusing. In part this is because the point at which type inference fails may not be the point at which the programmer has made a mistake. This paper explores a way of making type inference algorithms fail at different locations in programs so that clearer error messages may then be produced.
Critical to the operation of type inference algorithms is their use of substitutions. We will see that the way in which substitutions are applied in type inference algorithm W means that errors are detected towards the right-hand side of expressions. This paper introduces a new operation — unification of substitutions — which allows greater control over the use of substitutions so that this bias can be removed.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
M. Beaven and R. Stansifer. Explaining Type Errors in Polymorphic Languages. ACM Letters on Programming Languages and Systems, 2(1):17–30, March 1993.
K.L. Bernstein and E.W. Stark. Debugging Type Errors (Full version). Technical report, State University of New York at Stony Brook, Computer Science Department, November 1995. http://www.cs.sunysb.edu/~stark/REPORTS/INDEX.html.
L. Cardelli. Basic Polymorphic Type-Checking. Science of Computer Programming, 8(2):147–172, 1987.
L.M.M. Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, The University of Edinburgh, April 1985. CST-33-85.
L.M.M. Damas and A.J.R.G. Milner. Principal Type-Schemes for Functional Programs. In Proc. 9th. ACM Symposium on Principles of Programming Languages (POPL’ 82), pages 207–212, 1982.
D. Duggan and F. Bent. Explaining Type Inference. Science of Computer Programming, (27):37–83, 1996.
G.F. Johnson and J.A. Walz. A Maximum-Flow Approach to Anomaly Isolation in Unification-Based Incremental Type-Inference. In Proc. 13th. ACM Symposium on Principles of Programming Languages (POPL’ 86), pages 44–57, 1986.
K. Knight. Unification: A Multidisciplinary Survey. ACM Computing Surveys, 21(1):93–124, 1989.
O. Lee and K. Yi. Proofs About a Folklore Let-Polymorphic Type Inference Algorithm. ACM Transactions on Programming Languages and Systems, 1999. To Appear.
B.J. McAdam. On the Unification of Substitutions in Type-Inference. Technical Report ECS-LFCS-98-384, Laboratory for Foundations of Computer Science, The University of Edinburgh, James Clerk Maxwell Building, The Kings Buildings, Mayfield Road, Edinburgh, UK, March 1998.
S.L. Peyton Jones and P.L. Wadler. Imperative Functional Programming. In Proc. 20th. ACM Symposium on Principles of Programming Languages (POPL’ 93), pages 71–84, January 1993.
M. Tofte. Four Lectures on Standard ML. Technical Report ECS-LFCS-89-73, Laboratory for Foundations of Computer Science, The University of Edinburgh, March 1989.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
McAdam, B.J. (1999). On the Unification of Substitutions in Type Inference. In: Hammond, K., Davie, T., Clack, C. (eds) Implementation of Functional Languages. IFL 1998. Lecture Notes in Computer Science, vol 1595. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48515-5_9
Download citation
DOI: https://doi.org/10.1007/3-540-48515-5_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66229-7
Online ISBN: 978-3-540-48515-5
eBook Packages: Springer Book Archive