Skip to main content

Partiality and Container Monads

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10695))

Abstract

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    It is also called the partiality monad, but we want to use a more specific term here.

  2. 2.

    Notice that, if \(X:\mathcal {U}\), then \(\llbracket S,P \rrbracket ^\mathrm {c}\,X : \mathcal {U}_1\), i.e., \(\llbracket S,P \rrbracket ^\mathrm {c}\) would not be an endofunctor. But if \(X:\mathcal {U}_1\), then also \(\llbracket S,P \rrbracket ^\mathrm {c}\,X : \mathcal {U}_1\). Therefore we think of \(\llbracket S,P \rrbracket ^\mathrm {c}\) as a monad on \(\mathcal {U}_1\).

References

  1. Abbott, M., Altenkirch, T., Ghani, N.: Containers: constructing strictly positive types. Theor. Comput. Sci. 342(1), 3–27 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  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. 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). https://doi.org/10.1007/978-3-662-54458-7_31

    Chapter  Google Scholar 

  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. Bove, A., Krauss, A., Sozeau, M.: Partiality and recursion in interactive theorem provers–an overview. Math. Struct. Comput. Sci. 26(1), 38–88 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  6. Bucalo, A., Führmann, C., Simpson, A.: An equational notion of lifting monad. Theor. Comput. Sci. 294(1–2), 31–60 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  7. Capretta, V.: General recursion via coinductive types. Log. Methods Comput. Sci. 1(2), Article 1 (2005)

    Google Scholar 

  8. Chapman, J., Uustalu, T., Veltri, N.: Quotienting the delay monad by weak bisimilarity. Math. Struct. Comput. Sci. (to appear)

    Google Scholar 

  9. Cockett, J.R.B., Lack, S.: Restriction categories I: categories of partial maps. Theor. Comput. Sci. 270(1–2), 223–259 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  10. Cockett, J.R.B., Lack, S.: Restriction categories II: partial map classification. Theor. Comput. Sci 294(1–2), 61–102 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  11. Cockett, J.R.B., Lack, S.: Restriction categories III: colimits, partial limits, and extensivity. Math. Struct. Comput. Sci. 17(4), 775–817 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  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. Escardó, M.H.: Synthetic topology of data types and classical spaces. Electron. Notes Theor. Comput. Sci. 87, 21–156 (2004)

    MATH  Google Scholar 

  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. Johnstone, P.T.: Topos Theory. London Mathematical Society Monographs, vol. 10. Cambridge University Press, Cambridge (1977)

    Google Scholar 

  16. Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  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). https://doi.org/10.1007/978-3-642-04652-0_5

    Chapter  Google Scholar 

  18. Robinson, E., Rosolini, G.: Categories of partial maps. Inf. Comput. 79(2), 95–130 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  19. Rosolini, G.: Continuity and Effectiveness in Topoi. DPhil thesis, University of Oxford (1986)

    Google Scholar 

  20. Univalent Foundations Program, The: Homotopy Type theory: Univalent Foundations of Mathematics. Institute for Advanced Study, Princeton, NJ (2013). http://homotopytypetheory.org/book

  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). https://doi.org/10.1007/978-3-319-68953-1_8

    Chapter  Google Scholar 

  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). https://doi.org/10.1007/978-3-319-67729-3_3

    Google Scholar 

Download references

Acknowledgements

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.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Niccolò Veltri .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Uustalu, T., Veltri, N. (2017). Partiality and Container Monads. In: Chang, BY. (eds) Programming Languages and Systems. APLAS 2017. Lecture Notes in Computer Science(), vol 10695. Springer, Cham. https://doi.org/10.1007/978-3-319-71237-6_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-71237-6_20

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-71236-9

  • Online ISBN: 978-3-319-71237-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics