Implicit parameters: Dynamic scoping with static types

  • Lewis J
  • Launchbury J
  • Meijer E
 et al. 
  • 28

    Readers

    Mendeley users who have this article in their library.
  • 81

    Citations

    Citations of this article.

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 &lgr;-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.

Get free article suggestions today

Mendeley saves you time finding and organizing research

Sign up here
Already have an account ?Sign in

Find this document

Get full text

Authors

  • Jeffrey R. Lewis

  • John Launchbury

  • Erik Meijer

  • Mark B. Shields

Cite this document

Choose a citation style from the tabs below

Save time finding and organizing research with Mendeley

Sign up for free