Partiality, Revisited

The Partiality Monad as a Quotient Inductive-Inductive Type
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10203)


Capretta’s delay monad can be used to model partial computations, but it has the “wrong” notion of built-in equality, strong bisimilarity. An alternative is to quotient the delay monad by the “right” notion of equality, weak bisimilarity. However, recent work by Chapman et al. suggests that it is impossible to define a monad structure on the resulting construction in common forms of type theory without assuming (instances of) the axiom of countable choice.

Using an idea from homotopy type theory—a higher inductive-inductive type—we construct a partiality monad without relying on countable choice. We prove that, in the presence of countable choice, our partiality monad is equivalent to the delay monad quotiented by weak bisimilarity. Furthermore we outline several applications.


  1. 1.
    Altenkirch, T., Kaposi, A.: Type theory in type theory using quotient inductive types. In: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, pp. 18–29 (2016). doi:10.1145/2837614.2837638
  2. 2.
    Altenkirch, T., Capriotti, P., Dijkstra, G., Nordvall Forsberg, F.: Quotient inductive-inductive types. Preprint arXiv:1612.02346v1 [cs.LO] (2016)
  3. 3.
    Altenkirch, T., Danielsson, N.A., Kraus, N.: Code related to the paper “Partiality, revisited: The partiality monad as a quotient inductive-inductive type” (2017). Agda code,
  4. 4.
    Awodey, S., Gambino, N., Sojakova, K.: Inductive types in homotopy type theory. In: 2012 27th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pp. 95–104 (2012). doi:10.1109/LICS.2012.21
  5. 5.
    Benton, N., Kennedy, A., Varming, C.: Some domain theory and denotational semantics in coq. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 115–130. Springer, Heidelberg (2009). doi:10.1007/978-3-642-03359-9_10 CrossRefGoogle Scholar
  6. 6.
    Capretta, V.: General recursion via coinductive types. Logical Methods Comput. Sci. 1(2), 1–28 (2005). doi:10.2168/LMCS-1(2:1)2005 MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Capretta, V., Altenkirch, T., Uustalu, T.: Partiality is an effect. Slides for a talk given by Uustalu at the 22nd Meeting of IFIP Working Group 2.8 (2005).
  8. 8.
    Chapman, J., Uustalu, T., Veltri, N.: Quotienting the delay monad by weak bisimilarity. In: Leucker, M., Rueda, C., Valencia, F.D. (eds.) ICTAC 2015. LNCS, vol. 9399, pp. 110–125. Springer, Cham (2015). doi:10.1007/978-3-319-25150-9_8 CrossRefGoogle Scholar
  9. 9.
    Cockx, J., Abel, A.: Sprinkles of extensionality for your vanilla type theory. In: TYPES 2016, Types for Proofs and Programs, 22nd Meeting, Book of Abstracts (2016).
  10. 10.
    Coquand, T., Mannaa, B., Ruch, F.: Stack semantics of type theory. Preprint arXiv:1701.02571v1 [cs.LO] (2017)
  11. 11.
    Danielsson, N.A.: Operational semantics using the partiality monad. In: Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming, ICFP 2012, pp. 127–138 (2012). doi:10.1145/2364527.2364546
  12. 12.
    Dijkstra, G.: Quotient inductive-inductive definitions. Ph.D. thesis, University of Nottingham (2017). In preparationGoogle Scholar
  13. 13.
    Gilbert, G.: Formalising real numbers in homotopy type theory. In: Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2017, pp. 112–124 (2017). doi:10.1145/3018610.3018614
  14. 14.
    Hofmann, M.: Extensional concepts in intensional type theory. Ph.D. thesis, University of Edinburgh (1995)Google Scholar
  15. 15.
    Kraus, N., Escardó, M., Coquand, T., Altenkirch, T.: Generalizations of Hedberg’s theorem. In: Hasegawa, M. (ed.) TLCA 2013. LNCS, vol. 7941, pp. 173–188. Springer, Heidelberg (2013). doi:10.1007/978-3-642-38946-7_14 CrossRefGoogle Scholar
  16. 16.
    Li, N.: Quotient types in type theory. Ph.D. thesis, University of Nottingham (2015)Google Scholar
  17. 17.
    Lubarsky, R.S.: On the Cauchy completeness of the constructive Cauchy reals. Math. Logic Quart. 53(4–5), 396–414 (2007). doi:10.1002/malq.200710007 MathSciNetCrossRefMATHGoogle Scholar
  18. 18.
    Richman, F.: Constructive mathematics without choice. In: Schuster, P., Berger, U., Osswald, H. (eds.) Reuniting the Antipodes – Constructive and Nonstandard Views of the Continuum. Synthese Library, vol. 306, pp. 199–205. Springer Science+Business Media, Dordrecht (2001). doi:10.1007/978-94-015-9757-9_17 CrossRefGoogle Scholar
  19. 19.
    Sojakova, K.: Higher inductive types as homotopy-initial algebras. In: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, pp. 31–42 (2015). doi:10.1145/2676726.2676983
  20. 20.
    The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations of Mathematics, 1st edn. (2013).

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  1. 1.University of NottinghamNottinghamUK
  2. 2.University of GothenburgGothenburgSweden

Personalised recommendations