skip to main content
10.1145/325694.325708acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free Access

Implicit parameters: dynamic scoping with static types

Published:05 January 2000Publication History

ABSTRACT

This paper introduces a language feature, called implicit parameters, that provides dynamically scoped variables within a statically-typed Hindley-Milner framework. Implicit parameters are lexically distinct from regular identifiers, and are bound by a special with construct whose scope is dynamic, rather than static as with let. Implicit parameters are treated by the type system as parameters that are not explicitly declared, but are inferred from their use.

We present implicit parameters within a small call-by-name λ-calculus. We give a type system, a type inference algorithm, and several semantics. We also explore implicit parameters in the wider settings of call-by-need languages with overloading, and call-by-value languages with effects. As a witness to the former, we have implemented implicit parameters as an extension of Haskell within the Hugs interpreter, which we use to present several motivating examples.

References

  1. 1.BENTON, N. A mixed linear and non-linear logic: Proofs, terms and models. Tech. Rep. 352, University of Cambridge Computer Laboratory, Oct. 1994.Google ScholarGoogle Scholar
  2. 2.GARRIGUE, J. Dynamic binding and lexical binding in a transformation calculus. In Proc. of the Fuji International Workshop on Functional and Logic Programming. (1995). Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.GARRIGUE, J., AND KACI, H. The Typed Polymorphic Label-Selective Lambda-Calculus. In Conference Record of POPL '94: 21st A GM SIGPLAN-SIGA GT Symposium on Principles of Programming Languages (Portland, Oregon, 1994). Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.HANSON, C. MIT Scheme Reference. Cambridge, MA: MIT Press, Apr. 96.Google ScholarGoogle Scholar
  5. 5.JONES, M. P. Qualified Types: Theory and Practice. Cambridge University Press, Cambridge, England, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.JONES, M. P. Exploring the design space for typebased implicit parameterization. Tech. rep., Oregon Graduate Institute, July 1999.Google ScholarGoogle Scholar
  7. 7.JONES, M. P. Type classes with functional dependencies, Oct. 1999. (Submitted for publication).Google ScholarGoogle Scholar
  8. 8.JONES, M. P., AND PETERSON, J. C. Hugs 98 user manual, http://~--~.haskell, org/hugs/, May 1999.Google ScholarGoogle Scholar
  9. 9.KING, D. J., AND LAUNCHBUI~~, J. Structuring depthfirst search algorithms in Haskell. In A CM Symposium on Principles of Programming Languages (San Francisco, California, Jan. 1995), pp. 344-354. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.LIANG, S. The Java Native Interface (Programmer's guide and Specification). The Java Series. Addison Wesley, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.MEIJER, E., AND CLAESSEN, K. The design and implementation of Mondrian. In Proceedings o/the HaskeU Workshop (1997).Google ScholarGoogle Scholar
  12. 12.MILNER, R., TOFTE, M:, HARPER, R., AND MAC- QUEEN, I). The Definition of Standard ML- Revised. The MIT Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.ODERSKY, M., WADLER, P., AND WEHR, M. A second look at overloading. In Proceedings of the 1995 Conference on Functional Programming Languages and Computer Architecture (San Diego, CMifornia, June 1995), ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.PEYTON JONES, S., AND HUGHES, J. Haskell 98: A non-strict, purely functional language. http ://haskell. cs. yale. edu/onlinereport/, Jan. 1999.Google ScholarGoogle Scholar
  15. 15.REMY, D. Typechecking records and variants in a natural extension of ML. In Conference Record of fhe Sixteenth Annual A CM Symposium on Principles of Programming Languages (Austin, Texas, Jan. 1989). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.WADLER, P., AND BLOTT, S. How to make ad-hoc polymorphism less ad hoc. In Conference Record of the Sixteenth Annual A CM Symposium on Principles of Programming Languages (1989). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Implicit parameters: dynamic scoping with static types

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          POPL '00: Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2000
          402 pages
          ISBN:1581131259
          DOI:10.1145/325694

          Copyright © 2000 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 5 January 2000

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          POPL '00 Paper Acceptance Rate30of151submissions,20%Overall Acceptance Rate824of4,130submissions,20%

          Upcoming Conference

          POPL '25

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader