Turing-Completeness Totally Free

  • Conor McBrideEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9129)


In this paper, I show that general recursive definitions can be represented in the free monad which supports the ‘effect’ of making a recursive call, without saying how these calls should be executed. Diverse semantics can be given within a total framework by suitable monad morphisms. The Bove-Capretta construction of the domain of a general recursive function can be presented datatype-generically as an instance of this technique. The paper is literate Agda, but its key ideas are more broadly transferable.


Recursive Call Recursive Definition False Confession General Recursion Strong Bisimulation 
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.


  1. 1.
    Abel, A.: Type-based termination: a polymorphic lambda-calculus with sized higher-order types. Ph.D. thesis, Ludwig Maximilians University Munich (2007)Google Scholar
  2. 2.
    Abel, A., Chapman, J.: Normalization by evaluation in the delay monad: a case study for coinduction via copatterns and sized types. In: Levy, P., Krishnaswami, N. (eds.) Workshop on Mathematically Structured Functional Programming 2014, vol. 153 of EPTCS, pp. 51–67 (2014)Google Scholar
  3. 3.
    Abel, A., Pientka, B., Thibodeau, D., Setzer, A.: Copatterns: programming infinite structures by observations. In: Giacobazzi, R., Cousot, R. (eds.) ACM Symposium on Principles of Programming Languages, POPL 2013, ACM, pp. 27–38 (2013)Google Scholar
  4. 4.
    Altenkirch, T., Chapman, J., Uustalu, T.: Monads need not be endofunctors. In: Ong, L. (ed.) FOSSACS 2010. LNCS, vol. 6014, pp. 297–311. Springer, Heidelberg (2010) CrossRefGoogle Scholar
  5. 5.
    Altenkirch, T., Reus, B.: Monadic presentations of lambda terms using generalized inductive types. In: Flum, J., Rodríguez-Artalejo, M. (eds.) CSL 1999. LNCS, vol. 1683, pp. 453–468. Springer, Heidelberg (1999) CrossRefGoogle Scholar
  6. 6.
    Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J. Log. Algebr. Meth. Program. 84(1), 108–123 (2015)zbMATHMathSciNetCrossRefGoogle Scholar
  7. 7.
    Bove, A.: Simple general recursion in type theory. Nord. J. Comput. 8(1), 22–42 (2001)zbMATHMathSciNetGoogle Scholar
  8. 8.
    Bove, A., Capretta, V.: Nested general recursion and partiality in type theory. In: Boulton, R.J., Jackson, P.B. (eds.) TPHOLs 2001. LNCS, vol. 2152, pp. 121–135. Springer, Heidelberg (2001) CrossRefGoogle Scholar
  9. 9.
    Brady, E., McBride, C., McKinna, J.: Inductive families need not store their indices. In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, pp. 115–129. Springer, Heidelberg (2004) CrossRefGoogle Scholar
  10. 10.
    Capretta, V.: General recursion via coinductive types. Log. Meth. Comput. Sci. 1(2), 1–28 (2005)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Dybjer, P., Setzer, A.: A finite axiomatization of inductive-recursive definitions. In: Girard, J.-Y. (ed.) TLCA 1999. LNCS, vol. 1581, pp. 129–146. Springer, Heidelberg (1999) CrossRefGoogle Scholar
  12. 12.
    Dybjer, P., Setzer, A.: Indexed induction-recursion. In: Kahle, R., Schroeder-Heister, P., Stärk, R.F. (eds.) PTCS 2001. LNCS, vol. 2183, pp. 93–113. Springer, Heidelberg (2001) CrossRefGoogle Scholar
  13. 13.
    Ghani, N., Hancock, P.: Containers, monads and induction recursion. Math. Struct. Comput. Sci. FirstView: 1–25, 2 (2015)Google Scholar
  14. 14.
    Ghani, N., Lüth, C., De Marchi, F., Power, J.: Algebras, coalgebras, monads and comonads. Electr. Notes Theor. Comput. Sci. 44(1), 128–145 (2001)CrossRefGoogle Scholar
  15. 15.
    Giménez, E.: Codifying guarded definitions with recursive schemes. In: Smith, J., Dybjer, Peter, Nordström, Bengt (eds.) TYPES 1994. LNCS, vol. 996, pp. 39–59. Springer, Heidelberg (1994) CrossRefGoogle Scholar
  16. 16.
    Hancock, P., McBride, C., Ghani, N., Malatesta, L., Altenkirch, T.: Small Induction Recursion. In: Hasegawa, M. (ed.) TLCA 2013. LNCS, vol. 7941, pp. 156–172. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  17. 17.
    Martin-Löf, P.: Constructive mathematics and computer programming. In: Cohen, L.J., Los, J., Pfeiffer, H., Podewski, K.-P. (eds.) LMPS 6, pp. 153–175. North-Holland (1982)Google Scholar
  18. 18.
    Moggi, E.: Computational lambda-calculus and monads. In: Proceedings of the Fourth Annual Symposium on Logic in Computer Science (LICS 1989), pp. 14–23. IEEE Computer Society, Pacific Grove, California, USA, 5–8 June 1989Google Scholar
  19. 19.
    Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991)zbMATHMathSciNetCrossRefGoogle Scholar
  20. 20.
    Plotkin, G.D., Power, J.: Algebraic operations and generic effects. Appl. Categorical Struct. 11(1), 69–94 (2003)zbMATHMathSciNetCrossRefGoogle Scholar
  21. 21.
    Turner, D.A.: Total functional programming. J. Univ. Comput. Sci. 10(7), 751–768 (2004)Google Scholar
  22. 22.
    Uustalu, T.: Partiality is an effect. Talk Given at Dagstuhl Seminar on Dependently Typed Programming. (2004)

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.University of StrathclydeGlasgowScotland, UK

Personalised recommendations