Abstract
We propose a novel, comonadic approach to dataflow (stream-based) computation. This is based on the observation that both general and causal stream functions can be characterized as coKleisli arrows of comonads and on the intuition that comonads in general must be a good means to structure context-dependent computation. In particular, we develop a generic comonadic interpreter of languages for context-dependent computation and instantiate it for stream-based computation. We also discuss distributive laws of a comonad over a monad as a means to structure combinations of effectful and context-dependent computation. We apply the latter to analyse clocked dataflow (partial stream based) computation.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aczel, P., Adámek, J., Milius, S., Velebil, J.: Infinite trees and completely iterative theories: A coalgebraic view. Theoret. Comput. Sci. 300(1-3), 1–45 (2003)
Ashcroft, E.A., Wadge, W.W.: LUCID, The Dataflow Programming Language. Academic Press, New York (1985)
Ashcroft, E.A., Faustini, A.A., Jagannathan, R., Wadge, W.W.: Multidimensional Programming. Oxford University Press, New York (1995)
Barbier, B.: Solving stream equation systems. In: Actes 13mes Journées Francophones des Langages Applicatifs, JFLA 2002, pp. 117–139 (2002)
Benton, N., Bierman, G., de Paiva, V., Hyland, M.: Linear lambda-calculus and categorical models revisited. In: Martini, S., Börger, E., Kleine Büning, H., Jäger, G., Richter, M.M. (eds.) CSL 1992. LNCS, vol. 702, pp. 61–84. Springer, Heidelberg (1993)
Benton, N., Hughes, J., Moggi, E.: Monads and effects. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) APPSEM 2000. LNCS, vol. 2395, pp. 42–122. Springer, Heidelberg (2002)
Bierman, G., de Paiva, V.: On an intuitionistic modal logic. Studia Logica 65(3), 383–416 (2000)
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 Lecture Note Series, vol. 177, pp. 1–44. Cambridge Univ. Press, Cambridge (1992)
Caspi, P.: Clocks in dataflow languages. Theoret. Comput. Sci. 94(1), 125–140 (1992)
Caspi, P., Pouzet, M.: Synchronous Kahn networks. In: Proc. of 1st ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 1996, pp. 226–238. ACM Press, New York (1996); Also in SIGPLAN Notices 31(6), 226–238 (1996)
Caspi, P., Pouzet, M.: A co-iterative characterization of synchronous stream functions. In: Jacobs, B., Moss, L., Reichel, H., Rutten, J. (eds.) Proc. of 1st Wksh. on Coalgebraic Methods in Computer Science, CMCS 1998. Electron. Notes in Theoret. Comput. Sci., vol. 11. Elsevier, Amsterdam (1998)
Colaço, J.-L., Girault, A., Hamon, G., Pouzet, M.: Towards a higher-order synchronous data-flow language. In: Proc. of 4th ACM Int. Conf. on Embedded Software, EMSOFT 2004, pp. 230–239. ACM Press, New York (2004)
Colaço, J.-L., Pouzet, M.: Clocks and first class abstract types. In: Alur, R., Lee, I. (eds.) EMSOFT 2003. LNCS, vol. 2855, pp. 134–155. Springer, Heidelberg (2003)
Davies, R., Pfenning, F.: A modal analysis of staged computation. J. of ACM 48(3), 555–604 (2001)
Halbwachs, N., Caspi, P., Raymond, P., Pilaud, D.: The synchronous data flow programming language LUSTRE. Proc. of the IEEE 79(9), 1305–1320 (1991)
Hudak, P., Courtney, A., Nilsson, H., Peterson, J.: Arrows, robots, and functional programming. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 159–187. Springer, Heidelberg (2003)
Hughes, J.: Generalising monads to arrows. Sci. of Comput. Program. 37(1-3), 67–111 (2000)
Hughes, J.: Programming with arrows. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 73–129. Springer, Heidelberg (2005)
Kieburtz, R.B.: Codata and comonads in Haskell. Unpublished manuscript (1999)
Kieburtz, R.B.: Coalgebraic techniques for reactive functional programming. In: Actes 11mes Journées Francophones des Langages Applicatifs, JFLA 2000, pp. 131–157 (2000)
Lewis, J.R., Shields, M.B., Meijer, E., Launchbury, J.: Implicit parameters: Dynamic scoping with static types. In: Proc. of 27th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 2000, pp. 108–118. ACM Press, New York (2000)
Moggi, E.: Notions of computation and monads. Inform. and Comput. 93(1), 55–92 (1991)
Nilsson, H., Courtney, A., Peterson, J.: Functional reactive programming, continued. In: Proc. of 2002 ACM SIGPLAN Wksh. on Haskell, Haskell 2002, pp. 51–64. ACM Press, New York (2002)
Pardo, A.: Generic accumulations. In: Gibbons, J., Jeuring, J. (eds.) Proc. of IFIP TC2/WG2.1 Working Conference on Generic Programming. IFIP Conf. Proc., vol. 243, pp. 49–78. Kluwer, Dordrecht (2003)
Paterson, R.: A new notation for arrows. In: Proc. of 6th ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 2001, pp. 229–240. ACM Press, New York (2001); Also in SIGPLAN Notices 36(10), 229–240 (2001)
Paterson, R.: Arrows and computation. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, Cornerstones of Computing, pp. 201–222. Palgrave Macillan, Basingstoke (2003)
Pouzet, M.: Lucid Synchrone: tutorial and reference manual. Unpublished manuscript (2001)
Power, J., Robinson, E.: Premonoidal categories and notions of computation. Math. Structures in Comput. Sci. 7(5), 453–468 (1997)
Power, J., Watanabe, H.: Combining a monad and a comonad. Theoret. Comput. Sci. 280(1-2), 137–162 (2002)
Rutten, J.J.M.M.: Universal coalgebra: a theory of systems. Theoret. Comput. Sci. 249(1), 3–80 (2000)
Rutten, J.J.M.M.: Behavioural differential equations: a coinductive calculus of streams, automata, and power series. Theoret. Comput. Sci. 308(1-3), 1–53 (2003)
Uustalu, T., Vene, V.: The dual of substitution is redecoration. In: Hammond, K., Curtis, S. (eds.) Trends in Functional Programming 3, pp. 99–110. Intellect, Bristol (2002)
Uustalu, T., Vene, V.: Signals and comonads. In: Musicante, M.A., Lima, R.M.F. (eds.) Proc. of 9th Brazilian Symp. on Programming Languages, SBLP 2005, pp. 215–228. Univ. de Pernambuco, Recife (2005)
Uustalu, T., Vene, V., Pardo, A.: Recursion schemes from comonads. Nordic J. of Computing 8(3), 366–390 (2001)
Wadler, P.: The essence of functional programming. In: Conf. Record of 19th Ann. ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 1992, pp. 1–14. ACM Press, New York (1992)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Uustalu, T., Vene, V. (2005). The Essence of Dataflow Programming. In: Yi, K. (eds) Programming Languages and Systems. APLAS 2005. Lecture Notes in Computer Science, vol 3780. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11575467_2
Download citation
DOI: https://doi.org/10.1007/11575467_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-29735-2
Online ISBN: 978-3-540-32247-4
eBook Packages: Computer ScienceComputer Science (R0)