The Essence of Dataflow Programming

  • Tarmo Uustalu
  • Varmo Vene
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4164)


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.


Stream Function Input Stream Functional Programming Unit Anticipation Type Constructor 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    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)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Ashcroft, E.A., Wadge, W.W.: LUCID, The Dataflow Programming Language. Academic Press, New York (1985)zbMATHGoogle Scholar
  3. 3.
    Ashcroft, E.A., Faustini, A.A., Jagannathan, R., Wadge, W.W.: Multidimensional Programming. Oxford University Press, New York (1995)zbMATHGoogle Scholar
  4. 4.
    Barbier, B.: Solving stream equation systems. In: Actes 13mes Journées Francophones des Langages Applicatifs, JFLA 2002, pp. 117–139 (2002)Google Scholar
  5. 5.
    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)Google Scholar
  6. 6.
    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)CrossRefGoogle Scholar
  7. 7.
    Bierman, G., de Paiva, V.: On an intuitionistic modal logic. Studia Logica 65(3), 383–416 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    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)Google Scholar
  9. 9.
    Capretta, V., Uustalu, T., Vene, V.: Recursive coalgebras from comonads. Inform. and Comput. 204(4), 437–468 (2006)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Caspi, P.: Clocks in dataflow languages. Theoret. Comput. Sci. 94(1), 125–140 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    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 ACM SIGPLAN Notices, 31(6), pp. 226–238 (1996)CrossRefGoogle Scholar
  12. 12.
    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)Google Scholar
  13. 13.
    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)CrossRefGoogle Scholar
  14. 14.
    Colaço, J.-L., Pouzet, M.: Clocks as first class abstract types. In: Alur, R., Lee, I. (eds.) EMSOFT 2003. LNCS, vol. 2855, pp. 134–155. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  15. 15.
    Davies, R., Pfenning, F.: A modal analysis of staged computation. J. of ACM 48(3), 555–604 (2001)CrossRefMathSciNetGoogle Scholar
  16. 16.
    Erkök, L., Launchbury, J.: Monadic recursive bindings. In: Proc. of 5th ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 2000, pp. 174–185. ACM Press, New York (2000); Also in ACM SIGPLAN Notices,vol. 35(9), pp. 174–185 (2000) CrossRefGoogle Scholar
  17. 17.
    Halbwachs, N., Caspi, P., Raymond, P., Pilaud, D.: The synchronous data flow programming language LUSTRE. Proc. of the IEEE 79(9), 1305–1320 (1991)CrossRefGoogle Scholar
  18. 18.
    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)CrossRefGoogle Scholar
  19. 19.
    Hughes, J.: Generalising monads to arrows. Sci. of Comput. Program 37(1–3), 67–111 (2000)zbMATHCrossRefGoogle Scholar
  20. 20.
    Hughes, J.: Programming with arrows. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 73–129. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  21. 21.
    Heunen, C., Jacobs, B.: Arrows, like monads, are monoids. In: Brookes, S., Mislove, M. (eds.) Proc. of 22nd Ann. Conf. on Mathematical Foundations of Programming Semantics, MFPS XXII. Electron. Notes in Theoret. Comput. Sci, vol. 158, pp. 219–236. Elsevier, Amsterdam (2006)Google Scholar
  22. 22.
    Jacobs, B., Hasuo, I.: Freyd is Kleisli, for arrows. In: McBride, C., Uustalu, T. (eds.) Proc. of Wksh. on Mathematically Structured Programming, MSFP 2006. Electron. Wkshs. in Computing. BCS (2006)Google Scholar
  23. 23.
    Kieburtz, R.B.: Codata and comonads in Haskell (unpublished) (manuscript, 2001)Google Scholar
  24. 24.
    Kieburtz, R.B.: Coalgebraic techniques for reactive functional programming. In: Actes 11mes Journées Francophones des Langages Applicatifs, JFLA 2000, pp. 131–157 (2000)Google Scholar
  25. 25.
    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)CrossRefGoogle Scholar
  26. 26.
    Moggi, E.: Notions of computation and monads. Inform. and Comput. 93(1), 55–92 (1991)zbMATHCrossRefMathSciNetGoogle Scholar
  27. 27.
    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)CrossRefGoogle Scholar
  28. 28.
    Pardo, A.: Generic accumulations. In: Gibbons, J., Jeuring, J. (eds.) Proc. of IFIP TC2/WG2.1 Working Conf. on Generic Programming. IFIP Conf. Proc., vol. 243, pp. 49–78. Kluwer, Dordrecht (2003)Google Scholar
  29. 29.
    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 ACM SIGPLAN Notices, vol. 36(10), pp. 229–240 (2001) CrossRefGoogle Scholar
  30. 30.
    Paterson, R.: Arrows and computation. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, Cornerstones of Computing, pp. 201–222. Palgrave MacMillan, Basingstoke / New York (2003)Google Scholar
  31. 31.
    Pouzet, M.: Lucid Synchrone: tutorial and reference manual (unpublished) (manuscript, 2001)Google Scholar
  32. 32.
    Power, J., Robinson, E.: Premonoidal categories and notions of computation. Math. Structures in Comput. Sci. 7(5), 453–468 (1997)zbMATHCrossRefMathSciNetGoogle Scholar
  33. 33.
    Power, J., Watanabe, H.: Combining a monad and a comonad. Theoret. Comput. Sci. 280(1–2), 137–162 (2002)zbMATHCrossRefMathSciNetGoogle Scholar
  34. 34.
    Rutten, J.J.M.M.: Universal coalgebra: a theory of systems. Theoret. Comput. Sci. 249(1), 3–80 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  35. 35.
    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)zbMATHCrossRefMathSciNetGoogle Scholar
  36. 36.
    Uustalu, T., Vene, V.: The dual of substitution is redecoration. In: Hammond, K., Curtis, S. (eds.) Trends in Functional Programming, vol. 3, pp. 99–110. Intellect, Bristol / Portland (2002)Google Scholar
  37. 37.
    Uustalu, T., Vene, V.: Signals and comonads. J. of Univ. Comput. Sci. 11(7), 1310–1326 (2005)Google Scholar
  38. 38.
    Uustalu, T., Vene, V.: The Essence of Dataflow Programming (short version). In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 2–18. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  39. 39.
    Uustalu, T., Vene, V., Pardo, A.: Recursion schemes from comonads. Nordic J. of Computing 8(3), 366–390 (2001)zbMATHMathSciNetGoogle Scholar
  40. 40.
    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)CrossRefGoogle Scholar
  41. 41.
    Wadler, P.: Monads for functional programming. In: Broy, M. (ed.), Program Design Calculi: Proc. of Marktoberdorf Summer School 1992. NATO ASI Series F, vol. 118, pp. 233–264. Springer, Berlin (1993); Also in Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 24–52. Springer, Heidelberg (1995)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Tarmo Uustalu
    • 1
  • Varmo Vene
    • 2
  1. 1.Inst. of Cybernetics at Tallinn Univ. of TechnologyTallinnEstonia
  2. 2.Dept. of Computer ScienceUniv. of TartuTartuEstonia

Personalised recommendations