Monad Translating Inductive and Coinductive Types

  • Tarmo Uustalu
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2646)

Abstract

We show that the call-by-name monad translation of simply typed lambda calculus extended with sum and product types extends to special and general inductive and coinductive types so that its crucial property of preserving typings and β- and commuting reductions is maintained. Specific similar-purpose translations such as CPS translations follow from the general monad translations by specialization for appropriate concrete monads.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abel, A.: A third-order representation of the λμ-calculus. In: Ambler, S. J., Crole, R. L., Momigliano, A. (eds.): Proc. of Wksh. on Mechanised Reasoning about Languages with Variable Binding, MERLIN 2001 (Siena, June 2001). Electr. Notes in Theor. Comput. Sci., Vol. 58(1). Elsevier, Amsterdam (2001)Google Scholar
  2. 2.
    Barthe, G., Hatcliff, J., Sørensen, M. H. B.: CPS translations and applications: The cube and beyond. Higher-Order and Symbolic Comput. 12(2) (1999) 125–170MATHCrossRefGoogle Scholar
  3. 3.
    Barthe, G., Hatcliff, J., Thiemann, P.: Monadic type systems: Pure type systems for impure settings (preliminary report). In: Gordon, A., Pitts, A., Talcott, C. (eds.): Proc. of 2nd Wksh. on Higher-Order Operational Techniques in Semantics, HOOTS’97 (Stanford Univ., CA, Dec. 1997). Electr. Notes in Theor. Comput. Sci., Vol. 10. Elsevier, Amsterdam (1998)Google Scholar
  4. 4.
    Barthe, G., Uustalu, T.: CPS translating inductive and coinductive types (extended abstract). In: Proc. of 2002 ACM SIGPLAN Wksh. on Partial Evaluation and Semantics-Based Program Manipulation, PEPM’02 (Portland, OR, Jan. 2002). SIGPLAN Notices 37(3). ACM Press, New York (2002) 131–142Google Scholar
  5. 5.
    Benton, P. N., Bierman, G. M., de Paiva, V. C. V.: Computational types from a logical perspective. J. of Funct. Prog. 8(2) (1998) 177–193MATHCrossRefGoogle Scholar
  6. 6.
    Cockett, R., Fukushima, T.: About Charity. Yellow Series Report 92/480/18, Dept. of Computer Science, Univ. of Calgary (1992)Google Scholar
  7. 7.
    Curry, H. B.: The elimination theorem when modality is present. J. of Symb. Logic 17(4) (1952) 249–265MATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Fairtlough, M., Mendler, M.: Propositional lax logic. Inform. and Comput. 137(1) (1997) 1–33MATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    Geuvers, H.: Inductive and coinductive types with iteration and recursion. In: Nordström, B., Pettersson, K., Plotkin, G. (eds.): Proc. of Wksh. on Types for Proofs and Programs (Båastad, June 1992). Dept. of Computing Science, Chalmers Univ. of Technology and Göteborg Univ. (1992) 193–217Google Scholar
  10. 10.
    Hatcliff, J., Danvy, O.: A generic account of continuation passing styles. In: Conf. Record of 21st Ann. ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL’94 (Portland, OR, Jan. 1994). ACM Press, New York (1994) 458–471CrossRefGoogle Scholar
  11. 11.
    Leivant, D.: Contracting proofs to programs. In: Odifreddi, P. (ed.): Logic and Computer Science. APIC Studies in Data Processing, Vol. 31. Academic Press, London (1990) 279–327Google Scholar
  12. 12.
    Mendler, N. P.: Recursive types and type constraints in second-order lambda-calculus. In: Proc. of 2nd Ann. IEEE Symp. on Logic in Computer Science, LICS’87 (Ithaca, NY, June 1987). IEEE CS Press, Washington, DC (1987) 30–36Google Scholar
  13. 13.
    Mendler, N. P.: Inductive types and type constraints in the second-order lambda-calculus. Ann. of Pure and Appl. Logic, 51(1–2) (1991) 159–172CrossRefMathSciNetMATHGoogle Scholar
  14. 14.
    Moggi, E.: Notions of computation and monads. Inform. and Comput. 93(1) (1991) 55–92MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Parigot, M.: λμ-calculus: An algorithmic interpretation of classical natural deduction. In: Voronkov, A. (ed.): Proc. of Int. Conf. on Logic Programming and Automated Reasoning, LPAR’92 (St Petersburg, July 1992). Lect. Notes in Artif. Intell., Vol. 624. Springer-Verlag, Berlin (1992) 190–201CrossRefGoogle Scholar
  16. 16.
    Plotkin, G. D:: Call-by-name, call-by-value and the λ-calculus. Theor. Comput. Sci. 1(2) (1975) 125–159MATHCrossRefMathSciNetGoogle Scholar
  17. 17.
    Spławski, Z., Urzyczyn, P.: Type fixpoints: Iteration vs. recursion. In: Proc. of 4th ACM SIGPLAN Int. Conf. on Functional Programming, ICFP’99 (Paris, Sept. 1999). SIGPLAN Notices 34(9). ACM Press, New York (1999) 102–113Google Scholar
  18. 18.
    Wadler, P.: Comprehending monads. Math. Struct. in Comp. Sci. 2(4) (1992) 461–493MATHMathSciNetCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Tarmo Uustalu
    • 1
  1. 1.Inst. of CyberneticsTallinn Technical UniversityTallinnEstonia

Personalised recommendations