Skip to main content

Advertisement

SpringerLink
Log in
Menu
Find a journal Publish with us
Search
Cart
Book cover

International Conference on Foundations of Software Science and Computational Structures

FoSSaCS 2012: Foundations of Software Science and Computational Structures pp 74–88Cite as

  1. Home
  2. Foundations of Software Science and Computational Structures
  3. Conference paper
When Is a Container a Comonad?

When Is a Container a Comonad?

  • Danel Ahman17,
  • James Chapman18 &
  • Tarmo Uustalu18 
  • Conference paper
  • 1022 Accesses

  • 1 Citations

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 7213)

Abstract

Abbott, Altenkirch, Ghani and others have taught us that many parameterized datatypes (set functors) can be usefully analyzed via container representations in terms of a set of shapes and a set of positions in each shape. This paper builds on the observation that datatypes often carry additional structure that containers alone do not account for. We introduce directed containers to capture the common situation where every position in a datastructure determines another datastructure, informally, the sub-datastructure rooted by that position. Some natural examples are non-empty lists and node-labelled trees, and datastructures with a designated position (zippers). While containers denote set functors via a fully-faithful functor, directed containers interpret fully-faithfully into comonads. But more is true: every comonad whose underlying functor is a container is represented by a directed container. In fact, directed containers are the same as containers that are comonads. We also describe some constructions of directed containers. We have formalized our development in the dependently typed programming language Agda.

Download conference paper PDF

References

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

    CrossRef  MathSciNet  MATH  Google Scholar 

  2. Abbott, M., Altenkirch, T., Ghani, N., McBride, C.: Constructing Polymorphic Programs with Quotient Types. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 2–15. Springer, Heidelberg (2004)

    CrossRef  Google Scholar 

  3. Abbott, M., Altenkirch, T., Ghani, N., McBride, C.: δ for data: Differentiating data structures. Fund. Inform. 65(1-2), 1–28 (2005)

    MathSciNet  MATH  Google Scholar 

  4. Abbott, M.: Categories of Containers. Ph.D. thesis, University of Leicester (2003)

    Google Scholar 

  5. Altenkirch, T., Morris, P.: Indexed containers. In: Proc. of 24th Ann. IEEE Symp. on Logic in Computer Science, LICS 2009, pp. 277–285. IEEE CS Press (2009)

    Google Scholar 

  6. Brookes, S., Geva, S.: Computational comonads and intensional semantics. In: Fourman, M.P., Johnstone, P.T., Pitts, A.M. (eds.) Applications of Categories in Computer Science, London. Math. Society Lect. Note Series, vol. 77, pp. 1–44. Cambridge Univ. Press (1992)

    Google Scholar 

  7. Capobianco, S., Uustalu, T.: A categorical outlook on cellular automata. In: Kari, J. (ed.) Proc. of 2nd Symp. on Cellular Automata, JAC 2010. TUCS Lecture Note Series, vol. 13, pp. 88–89. Turku Centre for Comput. Sci. (2011)

    Google Scholar 

  8. Dybjer, P.: Representing inductively defined sets by wellorderings in Martin-Löf’s type theory. Theor. Comput. Sci. 176(1-2), 329–335 (1997)

    CrossRef  MathSciNet  MATH  Google Scholar 

  9. Gambino, N., Hyland, M.: Wellfounded Trees and Dependent Polynomial Functors. In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, pp. 210–225. Springer, Heidelberg (2004)

    CrossRef  Google Scholar 

  10. Gambino, N., Kock, J.: Polynomial functors and polynomial monads. Tech. Rep. 867, Centre de Recerca Matemàtica, Barcelona (2009)

    Google Scholar 

  11. Girard, J.Y.: Normal functors, power series and lambda-calculus. Ann. of Pure and Appl. Logic 37(2), 129–177 (1988)

    CrossRef  MathSciNet  MATH  Google Scholar 

  12. Hasuo, I., Jacobs, B., Uustalu, T.: Categorical Views on Computations on Trees. In: Arge, L., Cachin, C., Jurdziński, T., Tarlecki, A. (eds.) ICALP 2007. LNCS, vol. 4596, pp. 619–630. Springer, Heidelberg (2007)

    CrossRef  Google Scholar 

  13. Huet, G.: The zipper. J. of Funct. Program. 7, 549–554 (1997)

    CrossRef  MathSciNet  MATH  Google Scholar 

  14. Joyal, A.: Foncteurs analytiques et espèces de structures. In: Labelle, G., Leroux, P. (eds.) Combinatoire énumerative. Lect. Notes in Math., vol. 1234, pp. 126–159. Springer, Heidelberg (1987)

    CrossRef  Google Scholar 

  15. Kock, J.: Polynomial functors and trees. Int. Math. Research Notices 2011(3), 609–673 (2011)

    MathSciNet  MATH  Google Scholar 

  16. Moerdijk, I., Palmgren, E.: Wellfounded trees in categories. Ann. of Pure and Appl. Logic 104(1-3), 189–218 (2000)

    CrossRef  MathSciNet  MATH  Google Scholar 

  17. Morris, P.: Constructing Universes for Generic Programming. Ph.D. thesis, University of Nottingham (2007)

    Google Scholar 

  18. Norell, U.: Towards a Practical Programming Language Based on Dependent type Theory. Ph.D. thesis, Chalmers University of Technology (2007)

    Google Scholar 

  19. Prince, R., Ghani, N., McBride, C.: Proving Properties about Lists using Containers. In: Garrigue, J., Hermenegildo, M. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 97–112. Springer, Heidelberg (2008)

    CrossRef  Google Scholar 

  20. Uustalu, T., Vene, V.: The Essence of Dataflow Programming. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 2–18. Springer, Heidelberg (2005)

    CrossRef  Google Scholar 

  21. Uustalu, T., Vene, V.: Attribute evaluation is comonadic. In: van Eekelen, M. (ed.) Trends in Functional Programming, vol. 6, pp. 145–162. Intellect (2007)

    Google Scholar 

  22. Uustalu, T., Vene, V.: Comonadic notions of computation. In: Adámek, J., Kupke, C. (eds.) Proc. of 9th Int. Wksh. on Coalgebraic Methods in Computer Science, CMCS 2008. Electron. Notes in Theor. Comput. Sci., vol. 203(5), pp. 263–284. Elsevier (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

  1. Computer Laboratory, University of Cambridge, 15 J. J. Thomson Avenue, Cambridge, CB3 0FD, United Kingdom

    Danel Ahman

  2. Institute of Cybernetics, Tallinn University of Technology, Akadeemia tee 21, 12618, Tallinn, Estonia

    James Chapman & Tarmo Uustalu

Authors
  1. Danel Ahman
    View author publications

    You can also search for this author in PubMed Google Scholar

  2. James Chapman
    View author publications

    You can also search for this author in PubMed Google Scholar

  3. Tarmo Uustalu
    View author publications

    You can also search for this author in PubMed Google Scholar

Editor information

Editors and Affiliations

  1. IT University of Copenhagen, Rued Langgaards Vej 7, 2300, Copenhagen, Denmark

    Lars Birkedal

Rights and permissions

Reprints and Permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ahman, D., Chapman, J., Uustalu, T. (2012). When Is a Container a Comonad?. In: Birkedal, L. (eds) Foundations of Software Science and Computational Structures. FoSSaCS 2012. Lecture Notes in Computer Science, vol 7213. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28729-9_5

Download citation

  • .RIS
  • .ENW
  • .BIB
  • DOI: https://doi.org/10.1007/978-3-642-28729-9_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-28728-2

  • Online ISBN: 978-3-642-28729-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Search

Navigation

  • Find a journal
  • Publish with us

Discover content

  • Journals A-Z
  • Books A-Z

Publish with us

  • Publish your research
  • Open access publishing

Products and services

  • Our products
  • Librarians
  • Societies
  • Partners and advertisers

Our imprints

  • Springer
  • Nature Portfolio
  • BMC
  • Palgrave Macmillan
  • Apress
  • Your US state privacy rights
  • Accessibility statement
  • Terms and conditions
  • Privacy policy
  • Help and support

167.114.118.210

Not affiliated

Springer Nature

© 2023 Springer Nature