Abstract
Just as some functions have uniform behavior over distinct types, other functions have uniform behavior over distinct arities. These variable-arity functions are widely used in scripting languages such as Scheme and Python. Statically typed languages also accommodate modest forms of variable-arity functions, but even ML and Haskell, languages with highly expressive type systems, cannot type check the wide variety of variable-arity functions found in untyped functional languages. Consequently, their standard libraries contain numerous copies of the same function definition with slightly different names.
As part of the Typed Scheme project—an on-going effort to create an explicitly typed sister language for PLT Scheme—we have designed and implemented an expressive type system for variable-arity functions. Our practical validation in the context of our extensive code base confirms the usefulness of the enriched type system.
Chapter PDF
Similar content being viewed by others
Keywords
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.
References
Tobin-Hochstadt, S., Felleisen, M.: Interlanguage Migration: From Scripts to Programs. In: DLS 2006, Companion to OOPSLA, pp. 964–974 (2006)
Tobin-Hochstadt, S., Felleisen, M.: The Design and Implementation of Typed Scheme. In: POPL, pp. 395–406 (2008)
Flatt, M.: PLT MzScheme: Language Manual. Technical Report PLT-TR2008-1-v4.0.2, PLT Scheme Inc. (2008), http://www.plt-scheme.org/techreports/
Gansner, E.R., Reppy, J.H.: The Standard ML Basis Library. Cambridge University Press, New York (2002)
The GHC Team: The Glasgow Haskell Compiler User’s Guide (2008)
Findler, R.B., Felleisen, M.: Contracts for Higher-Order Functions. In: ACM SIGPLAN International Conference on Functional Programming, pp. 48–59 (2002)
Pierce, B.C., Turner, D.N.: Local Type Inference. ACM Trans. Program. Lang. Syst. 22(1), 1–44 (2000)
Dybvig, R.K., Hieb, R.: A new approach to procedures with variable arity. Lisp and Symbolic Computation: An International Journal 3(3) (1990)
Strickland, T.S., Tobin-Hochstadt, S., Felleisen, M.: Variable-Arity Polymorphism. Technical Report NU-CCIS-08-03, Northeastern University (2008)
Girard, J.Y.: Une extension de l’interprétation de Gödel à l’analyse, et son application à l’élimination de coupures dans l’analyse et la théorie des types. In: Fenstad, J.E. (ed.) Proceedings of the Second Scandinavian Logic Symposium, pp. 63–92. North-Holland Publishing Co., Amsterdam (1971)
Gosling, J., Joy, B.: The Java Language Specification, 3rd edn. Addison-Wesley, Reading (2005)
Dzeng, H., Haynes, C.T.: Type Reconstruction for Variable-Arity Procedures. In: LFP 1994, pp. 239–249. ACM Press, New York (1994)
Haynes, C.T.: Infer: A Statically-typed Dialect of Scheme. Technical Report 367, Indiana University (1995)
Gregor, D., Järvi, J.: Variadic templates for C++. In: SAC 2007, pp. 1101–1108. ACM Press, New York (2007)
Tullsen, M.: The Zip Calculus. In: Backhouse, R., Oliveira, J.N. (eds.) MPC 2000. LNCS, vol. 1837, pp. 28–44. Springer, Heidelberg (2000)
McBride, C.: Faking it: Simulating Dependent Types in Haskell. J. Funct. Program. 12(5), 375–392 (2002)
Moggi, E.: Arity polymorphism and dependent types. In: APPSEM Workshop on Subtyping and Dependent Types in Programming (July 7, 2000) (invited talk)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Strickland, T.S., Tobin-Hochstadt, S., Felleisen, M. (2009). Practical Variable-Arity Polymorphism. In: Castagna, G. (eds) Programming Languages and Systems. ESOP 2009. Lecture Notes in Computer Science, vol 5502. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-00590-9_3
Download citation
DOI: https://doi.org/10.1007/978-3-642-00590-9_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-00589-3
Online ISBN: 978-3-642-00590-9
eBook Packages: Computer ScienceComputer Science (R0)