Abstract
Arrows involving a loop operator provide an interesting programming methodology for looping computation. On the other hand, Haskell can define cyclic data structures by recursive definitions. This paper shows that there exists a common principle underlying both cyclic data and cyclic computations of arrow programs. We examine three concrete examples of constructing looping arrows from a syntactic structure called cyclic terms. Then we present a general pattern of constructing correct looping arrows, that is based on categorical semantics of loops and arrows, i.e. traced and Freyd categories.
Keywords
- Monoidal Category
- Symmetric Monoidal Category
- Cyclic Data
- Pure Function
- Cyclic Term
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Benton, N., Hyland, M.: Traced premonoidal categories. Theoretical Informatics and Applications 37(4), 273–299 (2003)
Crole, R.L.: Categories for Types. Cambridge Mathematical Textbook (1993)
Ghani, N., Hamana, M., Uustalu, T., Vene, V.: Representing cyclic structures as nested datatypes. In: Proceedings of Trends in Functional Programming, pp. 173–188 (2006)
Hasegawa, M.: Models of Sharing Graphs: A Categorical Semantics of let and letrec. PhD thesis, University of Edinburgh (1997)
Heunen, C., Jacobs, B.: Arrows, like monads, are monoids. In: Proc. of MFPS 22. ENTCS, vol. 158, pp. 219–236 (2006)
Hughes, J.: Generalising monads to arrows. Sci. Comput. Program. 37(1-3), 67–111 (2000)
Joyal, A., Street, R., Verity, D.: Traced monoidal categories. Mathematical Proceedings of the Cambridge Philosophical Society 119(3), 447–468 (1996)
Lindley, S., Wadler, P., Yallop, J.: The arrow calculus. Journal of Functional Programming 20(1), 51–69 (2010)
Paterson, R.: A new notation for arrows. In: Proc. of ICFP 2001, pp. 229–240 (2001)
Paterson, R.: Arrows and computation. In: The Fun of Programming, Cornerstones of Computing, pp. 201–222. Palgrave Macmillan (2003)
Power, J., Robinson, E.: Premonoidal categories and notions of computation. Mathematical Structures in Computer Science 7(5), 453–468 (1997)
Power, J., Thielecke, H.: Closed Freyd- and κ-categories. In: Wiedermann, J., Van Emde Boas, P., Nielsen, M. (eds.) ICALP 1999. LNCS, vol. 1644, pp. 625–634. Springer, Heidelberg (1999)
Simpson, A.K., Plotkin, G.D.: Complete axioms for categorical fixed-point operators. In: Proc. of LICS 2000, pp. 30–41 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hamana, M. (2012). Correct Looping Arrows from Cyclic Terms. In: Schrijvers, T., Thiemann, P. (eds) Functional and Logic Programming. FLOPS 2012. Lecture Notes in Computer Science, vol 7294. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-29822-6_13
Download citation
DOI: https://doi.org/10.1007/978-3-642-29822-6_13
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-29821-9
Online ISBN: 978-3-642-29822-6
eBook Packages: Computer ScienceComputer Science (R0)
