Partiality and Container Monads

  • Tarmo Uustalu
  • Niccolò VeltriEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10695)


We investigate monads of partiality in Martin-Löf type theory, following Moggi’s general monad-based method for modelling effectful computations. These monads are often called lifting monads and appear in category theory with different but related definitions. In this paper, we unveil the relationship between containers and lifting monads. We show that the lifting monads usually employed in type theory can be specified in terms of containers. Moreover, we give a precise characterization of containers whose interpretations carry a lifting monad structure. We show that these conditions are tightly connected with Rosolini’s notion of dominance. We provide several examples, putting particular emphasis on Capretta’s delay monad and its quotiented variant, the non-termination monad.



We are thankful to Thorsten Altenkirch and Martín Escardó for discussions and valuable hints.

This research was supported by the ERDF funded Estonian national CoE project EXCITE and the Estonian Ministry of Education and Research institutional research grant IUT33-13.


  1. 1.
    Abbott, M., Altenkirch, T., Ghani, N.: Containers: constructing strictly positive types. Theor. Comput. Sci. 342(1), 3–27 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Ahman, D., Chapman, J., Uustalu, T.: When is a container a comonad? Log. Methods Comput. Sci. 10(3), article 14 (2014)Google Scholar
  3. 3.
    Altenkirch, T., Danielsson, N.A., Kraus, N.: Partiality, revisited. The partiality monad as a quotient inductive-inductive type. In: Esparza, J., Murawski, A.S. (eds.) FoSSaCS 2017. LNCS, vol. 10203, pp. 534–549. Springer, Heidelberg (2017). CrossRefGoogle Scholar
  4. 4.
    Altenkirch, T., Pinyo, G.: Monadic containers and universes (abstract). In: Kaposi, A. (ed.) Abstracts of 23rd International Conference on Types for Proofs and Programs, TYPES 2017, pp. 20–21. Eötvös Lórand University, Budapest (2017)Google Scholar
  5. 5.
    Bove, A., Krauss, A., Sozeau, M.: Partiality and recursion in interactive theorem provers–an overview. Math. Struct. Comput. Sci. 26(1), 38–88 (2016)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Bucalo, A., Führmann, C., Simpson, A.: An equational notion of lifting monad. Theor. Comput. Sci. 294(1–2), 31–60 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Capretta, V.: General recursion via coinductive types. Log. Methods Comput. Sci. 1(2), Article 1 (2005)Google Scholar
  8. 8.
    Chapman, J., Uustalu, T., Veltri, N.: Quotienting the delay monad by weak bisimilarity. Math. Struct. Comput. Sci. (to appear)Google Scholar
  9. 9.
    Cockett, J.R.B., Lack, S.: Restriction categories I: categories of partial maps. Theor. Comput. Sci. 270(1–2), 223–259 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Cockett, J.R.B., Lack, S.: Restriction categories II: partial map classification. Theor. Comput. Sci 294(1–2), 61–102 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Cockett, J.R.B., Lack, S.: Restriction categories III: colimits, partial limits, and extensivity. Math. Struct. Comput. Sci. 17(4), 775–817 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Coquand, T., Mannaa, B., Ruch, F.: Stack semantics of type theory. In: Proceedings of 32th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017 (2017)Google Scholar
  13. 13.
    Escardó, M.H.: Synthetic topology of data types and classical spaces. Electron. Notes Theor. Comput. Sci. 87, 21–156 (2004)zbMATHGoogle Scholar
  14. 14.
    Escardó, M.H., Knapp, C.M.: Partial elements and recursion via dominances in univalent type theory. In: Goranko, V., Dam, M. (eds.) Proceedings of 26th EACSL Annual Conference on Computer Science Logic, CSL 2017, Leibniz International Proceedings in Informatics, vol. 82, article 21. Dagstuhl Publishing, Saarbrücken/Wadern (2017)Google Scholar
  15. 15.
    Johnstone, P.T.: Topos Theory. London Mathematical Society Monographs, vol. 10. Cambridge University Press, Cambridge (1977)Google Scholar
  16. 16.
    Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  17. 17.
    Norell, U.: Dependently typed programming in Agda. In: Koopman, P., Plasmeijer, R., Swierstra, D. (eds.) AFP 2008. LNCS, vol. 5832, pp. 230–266. Springer, Heidelberg (2009). CrossRefGoogle Scholar
  18. 18.
    Robinson, E., Rosolini, G.: Categories of partial maps. Inf. Comput. 79(2), 95–130 (1988)MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    Rosolini, G.: Continuity and Effectiveness in Topoi. DPhil thesis, University of Oxford (1986)Google Scholar
  20. 20.
    Univalent Foundations Program, The: Homotopy Type theory: Univalent Foundations of Mathematics. Institute for Advanced Study, Princeton, NJ (2013).
  21. 21.
    Uustalu, T.: Container combinatorics: monads and lax monoidal functors. In: Mousavi, M.R., Sgall, J. (eds.) TTCS 2017. LNCS, vol. 10608, pp. 91–105. Springer, Heidelberg (2017). CrossRefGoogle Scholar
  22. 22.
    Uustalu, T., Veltri, N.: The delay monad and restriction categories. In: Hung, D.V., Kapur, D. (eds.) ICTAC 2017. LNCS, vol. 10580, pp. 32–50. Springer, Heidelberg (2017). Google Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Department of Software ScienceTallinn University of TechnologyTallinnEstonia
  2. 2.IT University of CopenhagenCopenhagen SDenmark

Personalised recommendations