Typing references by effect inference

  • Andrew K. Wright
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 582)


Hindley/Milner-style polymorphism is a simple, natural, and flexible type discipline for functional languages, but incorporating imperative extensions is difficult. We present a new technique for typing references in the presence of polymorphism by inferring a concise summary of each expression's allocation behavior—a type effect. A simple technique for proving soundness with respect to a reduction semantics demonstrates that the type system prevents type errors. By establishing that the system corresponds to an alternate system better suited to implementation, we obtain an algorithm to perform type and effect inference.


Effect Variable Type System Type Variable Reference Cell Type Scheme 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. [1]
    Barendregt, H. P. The Lambda Calculus: Its Syntax and Semantics, revised ed., vol. 103 of Studies in Logic and the Foundations of Mathematics. North-Holland, Amsterdam, 1984.Google Scholar
  2. [2]
    Damas, L., and Milner, R. Principal type schemes for functional programs. Proceedings of the 9th Annual Symposium on Principles of Programming Languages (January 1982), 207–212.Google Scholar
  3. [3]
    Damas, L. M. M. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, 1985.Google Scholar
  4. [4]
    Deutsch, A. On determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications. Proceedings of the 17th Annual Symposium on Principles of Programming Languages (January 1990), 157–168.Google Scholar
  5. [5]
    Felleisen, M., and Friedman, D. P. A syntactic theory of sequential state. Theoretical Computer Science 69, 3 (1989), 243–287. Preliminary version in: Proceedings of the 14th Annual Symposium on Principles of Programming Languages, 1987, 314–325.Google Scholar
  6. [6]
    Felleisen, M., Friedman, D. P., Kohlbecker, E. E., and Duba, B. A syntactic theory of sequential control. Theoretical Computer Science 52, 3 (1987), 205–237. Preliminary version in: Proceedings of the Symposium on Logic in Computer Science, 1986, 131–141.Google Scholar
  7. [7]
    Felleisen, M., and Hieb, R. The revised report on the syntactic theories of sequential control and state. Tech. Rep. TR-100, Rice University, June 1989. To appear in: Theoretical Computer Science.Google Scholar
  8. [8]
    Hindley, R. The principal type-scheme of an object in combinatory logic. Transactions of the American Mathematical Society 146 (December 1969), 29–60.Google Scholar
  9. [9]
    Jouvelot, P., and Gifford, D. K. Algebraic reconstruction of types and effects. Proceedings of the 18th Annual Symposium on Principles of Programming Languages (January 1991), 303–310.Google Scholar
  10. [10]
    Leroy, X., and Weis, P. Polymorphic type inference and assignment. Proceedings of the 18th Annual Symposium on Principles of Programming Languages (January 1991), 291–302.Google Scholar
  11. [11]
    Lucassen, J. M., and Gifford, D. K. Polymorphic effect systems. Proceedings of the 15th Annual Symposium on Principles of Programming Languages (January 1988), 47–57.Google Scholar
  12. [12]
    Milner, R. A theory of type polymorphism in programming. Journal of Computer and System Sciences 17 (1978), 348–375.Google Scholar
  13. [13]
    Milner, R., and Tofte, M. Commentary on Standard ML. MIT Press, Cambridge, Massachusetts, 1991.Google Scholar
  14. [14]
    Milner, R., Tofte, M., and Harper, R. The Definition of Standard ML. MIT Press, Cambridge, Massachusetts, 1990.Google Scholar
  15. [15]
    O'Toole Jr., J. W. Type abstraction rules for references: A comparison of four which have achieved notoriety. Unpublished, 1990.Google Scholar
  16. [16]
    Standard ML of New Jersey release notes (version 0.75). AT&T Bell Laboratories, November 1991.Google Scholar
  17. [17]
    Talpin, J.-P., and Jouvelot, P. The type and effect discipline. Tech. Rep. EMP-CRI A/206, Ecole des Mines de Paris, July 1991.Google Scholar
  18. [18]
    Tofte, M. Type inference for polymorphic references. Information and Computation 89, 1 (November 1990), 1–34.Google Scholar
  19. [19]
    Wright, A. K., and Felleisen, M. A syntactic approach to type soundness. Tech. Rep. 91-160, Rice University, April 1991. To appear in: Information and Computation.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Andrew K. Wright
    • 1
  1. 1.Department of Computer ScienceRice UniversityHouston

Personalised recommendations