ABSTRACT
TheML module system is useful for building large-scale programs. The programmer can factor programs into nested and parameterized modules, and can control abstraction with signatures. Yet ML prohibits recursion between modules. As a result of this constraint, the programmer may have to consolidate conceptually separate components into a single module, intruding on modular programming. Introducing recursive modules is a natural way out of this predicament. Existing proposals, however, vary in expressiveness and verbosity. In this paper, we propose a type system for recursive modules, which can infer their signatures. Opaque signatures can also be given explicitly, to provide type abstraction either inside or outside the recursion. The type system is decidable, and is sound for a call-by-value semantics. We also present a solution to the expression problem, in support of our design choices.
- G. Boudol. The recursive record semantics of objects revisited. Journal of Functional Programming, 14:263--315, 2004. Google Scholar
Digital Library
- W.R. Cook. Object-Oriented Programming Versus Abstract Data Types. In Proc. REX Workshop, volume 489 of Lecture Notes in Computer Science. Springer-Verlag, 1990. Google Scholar
Digital Library
- K. Crary, R. Harper, and S. Puri. What is a recursive module? In Proc. PLDI'99, pages 50--63, 1999. Google Scholar
Digital Library
- D. Dreyer. A type system for well-founded recursion. In Proc. POPL'04, 2004. Google Scholar
Digital Library
- D. Dreyer. Recursive Type Generativity. In Proc. ICFP'05, 2005. Google Scholar
Digital Library
- D. Dreyer. Understanding and Evolving the ML Module System. PhD thesis, Carnegie Mellon University, 2005. Google Scholar
Digital Library
- J. Garrigue. Programming with polymorphic variants. In In Proc. ML workshop'98, 1998.Google Scholar
- J. Garrigue. Private rows: abstracting the unnamed. http://www.math.nagoya-u.ac.jp/⊄garrigue/papers/privaterows. pdf, 2005. Google Scholar
Digital Library
- R. Harper and M. Lillibridge. A type-theoretic approach to higherorder modules with sharing. In Proc. POPL'94, 1994. Google Scholar
Digital Library
- R. Harper, J.C. Mitchell, and E. Moggi. Higher-order modules and the phase distinction. In Porc. of POPL'90, pages 341--354, 1990. Google Scholar
Digital Library
- T. Hirschowitz and X. Leroy. Mixin modules in a call-by-value setting. In Proc. ESOP'02, pages 6--20, 2002. Google Scholar
Digital Library
- X. Leroy. Manifest types, modules, and separate compilation. In Proc. POPL'94, pages 109--122. ACM Press, 1994. Google Scholar
- X. Leroy. Applicative functors and fully transparent higher-order modules. In Proc. POPL'95, pages 142--153. ACM Press, 1995. Google Scholar
- X. Leroy. A modular module system. Journal of Functional Programming, 10(3):269--303, 2000. Google Scholar
Digital Library
- X. Leroy, D. Doligez, J. Garrigue, D. Rémy, and J. Vouillon. The Objective Caml system, release 3.09. Software and documentation available on the Web, http://caml.inria.fr/,2005.Google Scholar
- D. MacQueen. Modules for Standard ML. In Proc. the 1984 ACM Conference on LISP and Functional Programming, pages 198--207. ACM Press, 1984. Google Scholar
Digital Library
- R. Milner. Communicating and Mobile Systems: the pi-Calculus. Cambridge University Press, 1999. Google Scholar
Digital Library
- R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997. Google Scholar
Digital Library
- K. Nakata and J. Garrigue. Path resolution for recursive modules. Technical Report 1545, Kyoto University Research Institute for Mathematical Sciences, 2006.Google Scholar
- K. Nakata and J. Garrigue. Recursive modules for programming. Technical Report 1546, Kyoto University Research Institute for Mathematical Sciences, 2006.Google Scholar
Digital Library
- D. Rémy and J. Garrigue. On the expression problem. http://pauillac.inria.fr/~remy/work/expr/,2004.Google Scholar
- S. Romanenko, C. Russo, N. Kokholm, and P. Sestoft. Moscow ML, 2004. Software and documentation available on the Web, http://www.dina.dk/sestoft/mosml.html.Google Scholar
- C. Russo. Recursive Structures for Standard ML. In Proc. ICFP'01, pages 50--61. ACM Press, 2001. Google Scholar
Digital Library
- C. Stone. Type definitions. In Advanced Topics in Types and Programming Languages, chapter 9. The MIT Press, 2004.Google Scholar
- M. Torgersen. The Expression Problem Revisited. In European Conference on Object-Oriented Programming:LN CS, volume 3086. Springer-Verlag, 2004.Google Scholar
- P. Wadler. The expression problem. Java Genericity maling list, 1998. http://www.cse.ohio-state.edu/~gb/cis888. 07g/java-genericity/20.Google Scholar
- M. Zenger and M. Odersky. Independently Extensible Solutions to the Expression Problem. In Proc. FOOL 12, 2005.Google Scholar
Index Terms
Recursive modules for programming
Recommendations
Recursive modules for programming
Proceedings of the 2006 ICFP conferenceTheML module system is useful for building large-scale programs. The programmer can factor programs into nested and parameterized modules, and can control abstraction with signatures. Yet ML prohibits recursion between modules. As a result of this ...
Recursive type generativity
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingExistential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found ...
Recursive type generativity
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingExistential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found ...







Comments