|
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
BENTON, N. A mixed linear and non-linear logic: Proofs, terms and models. Tech. Rep. 352, University of Cambridge Computer Laboratory, Oct. 1994.
|
| |
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).
|
 |
3
|
|
| |
4
|
HANSON, C. MIT Scheme Reference. Cambridge, MA: MIT Press, Apr. 96.
|
| |
5
|
|
| |
6
|
JONES, M. P. Exploring the design space for typebased implicit parameterization. Tech. rep., Oregon Graduate Institute, July 1999.
|
| |
7
|
JONES, M. P. Type classes with functional dependencies, Oct. 1999. (Submitted for publication).
|
| |
8
|
JONES, M. P., AND PETERSON, J. C. Hugs 98 user manual, http://~--~.haskell, org/hugs/, May 1999.
|
 |
9
|
|
| |
10
|
|
| |
11
|
MEIJER, E., AND CLAESSEN, K. The design and implementation of Mondrian. In Proceedings o/the HaskeU Workshop (1997).
|
| |
12
|
|
 |
13
|
Martin Odersky , Philip Wadler , Martin Wehr, A second look at overloading, Proceedings of the seventh international conference on Functional programming languages and computer architecture, p.135-146, June 26-28, 1995, La Jolla, California, United States
[doi> 10.1145/224164.224195]
|
| |
14
|
PEYTON JONES, S., AND HUGHES, J. Haskell 98: A non-strict, purely functional language. http ://haskell. cs. yale. edu/onlinereport/, Jan. 1999.
|
 |
15
|
|
 |
16
|
|
CITED BY 32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gavin Bierman , Michael Hicks , Peter Sewell , Gareth Stoyle , Keith Wansbrough, Dynamic rebinding for marshalling and update, with destruct-time ?, ACM SIGPLAN Notices, v.38 n.9, p.99-110, September 2003
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Paul Hudak , John Hughes , Simon Peyton Jones , Philip Wadler, A history of Haskell: being lazy with class, Proceedings of the third ACM SIGPLAN conference on History of programming languages, p.12-1-12-55, June 09-10, 2007, San Diego, California
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Peter Sewell , Gareth Stoyle , Michael Hicks , Gavin Bierman , Keith Wansbrough, Dynamic rebinding for marshalling and update, via redex-time and destruct-time reduction, Journal of Functional Programming, v.18 n.4, p.437-502, July 2008
|
|
|
|
|