skip to main content
10.1145/1159803.1159813acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Recursive modules for programming

Published:16 September 2006Publication History

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.

References

  1. G. Boudol. The recursive record semantics of objects revisited. Journal of Functional Programming, 14:263--315, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Crary, R. Harper, and S. Puri. What is a recursive module? In Proc. PLDI'99, pages 50--63, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Dreyer. A type system for well-founded recursion. In Proc. POPL'04, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Dreyer. Recursive Type Generativity. In Proc. ICFP'05, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Dreyer. Understanding and Evolving the ML Module System. PhD thesis, Carnegie Mellon University, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Garrigue. Programming with polymorphic variants. In In Proc. ML workshop'98, 1998.Google ScholarGoogle Scholar
  8. J. Garrigue. Private rows: abstracting the unnamed. http://www.math.nagoya-u.ac.jp/⊄garrigue/papers/privaterows. pdf, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Harper and M. Lillibridge. A type-theoretic approach to higherorder modules with sharing. In Proc. POPL'94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. Hirschowitz and X. Leroy. Mixin modules in a call-by-value setting. In Proc. ESOP'02, pages 6--20, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. X. Leroy. Manifest types, modules, and separate compilation. In Proc. POPL'94, pages 109--122. ACM Press, 1994. Google ScholarGoogle Scholar
  13. X. Leroy. Applicative functors and fully transparent higher-order modules. In Proc. POPL'95, pages 142--153. ACM Press, 1995. Google ScholarGoogle Scholar
  14. X. Leroy. A modular module system. Journal of Functional Programming, 10(3):269--303, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle Scholar
  16. D. MacQueen. Modules for Standard ML. In Proc. the 1984 ACM Conference on LISP and Functional Programming, pages 198--207. ACM Press, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. Milner. Communicating and Mobile Systems: the pi-Calculus. Cambridge University Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Milner, M. Tofte, R. Harper, and D. MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. K. Nakata and J. Garrigue. Path resolution for recursive modules. Technical Report 1545, Kyoto University Research Institute for Mathematical Sciences, 2006.Google ScholarGoogle Scholar
  20. K. Nakata and J. Garrigue. Recursive modules for programming. Technical Report 1546, Kyoto University Research Institute for Mathematical Sciences, 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Rémy and J. Garrigue. On the expression problem. http://pauillac.inria.fr/~remy/work/expr/,2004.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle Scholar
  23. C. Russo. Recursive Structures for Standard ML. In Proc. ICFP'01, pages 50--61. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C. Stone. Type definitions. In Advanced Topics in Types and Programming Languages, chapter 9. The MIT Press, 2004.Google ScholarGoogle Scholar
  25. M. Torgersen. The Expression Problem Revisited. In European Conference on Object-Oriented Programming:LN CS, volume 3086. Springer-Verlag, 2004.Google ScholarGoogle Scholar
  26. P. Wadler. The expression problem. Java Genericity maling list, 1998. http://www.cse.ohio-state.edu/~gb/cis888. 07g/java-genericity/20.Google ScholarGoogle Scholar
  27. M. Zenger and M. Odersky. Independently Extensible Solutions to the Expression Problem. In Proc. FOOL 12, 2005.Google ScholarGoogle Scholar

Index Terms

  1. Recursive modules for programming

          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

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!