2000 character limit reached
What Monads Can and Cannot Do with a Few Extra Pages (2311.15919v3)
Published 27 Nov 2023 in cs.LO
Abstract: The delay monad provides a way to introduce general recursion in type theory. To write programs that use a wide range of computational effects directly in type theory, we need to combine the delay monad with the monads of these effects. Here we present a first systematic study of such combinations. We study both the coinductive delay monad and its guarded recursive cousin, giving concrete examples of combining these with well-known computational effects. We also provide general theorems stating which algebraic effects distribute over the delay monad, and which do not. Lastly, we salvage some of the impossible cases by considering distributive laws up to weak bisimilarity.
- Partiality, revisited. In International Conference on Foundations of Software Science and Computation Structures, pages 534–549. Springer, 2017.
- Productive coprogramming with guarded recursion. ACM SIGPLAN Notices, 48(9):197–208, 2013.
- The clocks are ticking: No more delays! In 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 1–12. IEEE, 2017.
- Monadic compiler calculation (functional pearl). Proc. ACM Program. Lang., 6(ICFP), August 2022. doi:10.1145/3547624.
- Greatest hits: Higher inductive types in coinductive definitions via induction under clocks. In Proceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science, pages 1–13, 2022.
- Jon Beck. Distributive laws. In B. Eckmann, editor, Seminar on Triples and Categorical Homology Theory, pages 119–140. Springer Berlin Heidelberg, 1969.
- First steps in synthetic guarded domain theory: step-indexing in the topos of trees. Logical Methods in Computer Science, 8(4), 2012.
- Venanzio Capretta. General recursion via coinductive types. Logical Methods in Computer Science, 1, 2005.
- Higher inductive types in cubical computational type theory. Proceedings of the ACM on Programming Languages, 3(POPL):1–27, 2019.
- Quotienting the delay monad by weak bisimilarity. Mathematical Structures in Computer Science, 29(1):67–92, 2019.
- Ranald Clouston. Fitch-style modal lambda calculi. In International Conference on Foundations of Software Science and Computation Structures, pages 258–275. Springer, 2018.
- Cubical type theory: A constructive interpretation of the univalence axiom. In 21st International Conference on Types for Proofs and Programs (TYPES 2015). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2018.
- Layer by layer - combining monads. In Theoretical Aspects of Computing - ICTAC 2018 - 15th International Colloquium, Stellenbosch, South Africa, October 16-19, 2018, Proceedings, pages 153–172, 2018. doi:10.1007/978-3-030-02508-3_9.
- Nils Anders Danielsson. Operational semantics using the partiality monad. SIGPLAN Not., 47(9):127–138, sep 2012. doi:10.1145/2398856.2364546.
- Selection functions, bar recursion and backward induction. Mathematical Structures in Computer Science, 20(2):127–168, 2010. doi:10.1017/S0960129509990351.
- ND Gautam. The validity of equations of complex algebras. Archiv für mathematische Logik und Grundlagenforschung, 3(3):117–124, 1957.
- Multimodal dependent type theory. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science, pages 492–506, 2020.
- Jules Hedges. Monad transformers for backtracking search. In Paul Levy and Neel Krishnaswami, editors, Proceedings 5th Workshop on Mathematically Structured Functional Programming, Grenoble, France, 12 April 2014, volume 153 of Electronic Proceedings in Theoretical Computer Science, pages 31–50. Open Publishing Association, 2014. doi:10.4204/EPTCS.153.3.
- Combining effects: Sum and tensor. Theoretical Computer Science, 357(1):70–99, 2006. doi:10.1016/j.tcs.2006.03.013.
- Discrete lawvere theories and computational effects. Theoretical Computer Science, 366(1-2):144–162, 2006.
- Iterated covariant powerset is not a monad. In Proceedings 34th Conference on the Mathematical Foundations of Programming Semantics, MFPS 2018, 2018.
- Anders Kock. Monads on symmetric monoidal closed categories. Archiv der Mathematik, 21(1):1–10, 1970.
- F. William Lawvere. Functorial semantics of algebraic theories. Proceedings of the National Academy of Sciences of the United States of America, 50(5):869–872, 1963.
- Fred EJ Linton. Some aspects of equational categories. In Proceedings of the Conference on Categorical Algebra, pages 84–94. Springer, 1966.
- Ernie Manes. Algebraic theories, volume 26. Springer, 1976.
- Monad compositions I: general constructions and recursive distributive laws. Theory and Applications of Categories, 18:172–208, 04 2007.
- Monad compositions II: Kleisli strength. Mathematical Structures in Computer Science, 18(3):613–643, 2008. doi:10.1017/S0960129508006695.
- Ticking clocks as dependent right adjoints: Denotational semantics for clocked type theory. Logical Methods in Computer Science, 16, 2020.
- Per Martin-Löf. Intuitionistic Type Theory. Bibliopolis, Napoli, 1984.
- Lambert Meertens. Algorithmics, towards programming as a mathematical activity. In J.W. De Bakker, M. Hazewinkel, and J.K. Lenstra, editors, Mathematics and Computer Science: Proceedings of the CWI Symposium, November 1983, CWI monographs, pages 289–334. North-Holland, 1986.
- Denotational semantics of recursive types in synthetic guarded domain theory. Mathematical Structures in Computer Science, 29(3):465–510, 2019.
- Two guarded recursive powerdomains for applicative simulation. In Ana Sokolova, editor, Proceedings 37th Conference on Mathematical Foundations of Programming Semantics, MFPS 2021, Hybrid: Salzburg, Austria and Online, 30th August - 2nd September, 2021, volume 351 of EPTCS, pages 200–217, 2021. doi:10.4204/EPTCS.351.13.
- Hiroshi Nakano. A modality for recursion. In Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science, pages 255–266. IEEE, 2000.
- Louis Parlant. Monad Composition via Preservation of Algebras. PhD thesis, UCL (University College London), 2020.
- Preservation of equations by monoidal monads. In 45th International Symposium on Mathematical Foundations of Computer Science (MFCS 2020). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2020.
- A model of PCF in guarded type theory. Electronic Notes in Theoretical Computer Science, 319:333–349, 2015.
- Notions of computation determine monads. In International Conference on Foundations of Software Science and Computation Structures, pages 342–356. Springer, 2002.
- Denotational semantics of general store and polymorphism. Unpublished manuscript, July 2022.
- The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Mathematics. https://homotopytypetheory.org/book, Institute for Advanced Study, 2013.
- Distributing probability over non-determinism. Mathematical Structures in Computer Science, 16(1):87–113, 2006.
- Niccolò Veltri and Niels F. W. Voorneveld. Inductive and coinductive predicate liftings for effectful programs. In Ana Sokolova, editor, Proceedings 37th Conference on Mathematical Foundations of Programming Semantics, MFPS 2021, Hybrid: Salzburg, Austria and Online, 30th August - 2nd September, 2021, volume 351 of EPTCS, pages 260–277, 2021. doi:10.4204/EPTCS.351.16.
- Interaction trees: Representing recursive and impure programs in Coq. Proc. ACM Program. Lang., 4(POPL), dec 2019. doi:10.1145/3371119.
- No-go theorems for distributive laws. In 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LiCS), pages 1–13, 2019. doi:10.1109/LICS.2019.8785707.