Skip to main content

Static and Dynamic Visualisations of Monadic Programs

  • Chapter
  • First Online:
Central European Functional Programming School (CEFP 2015)

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

Included in the following conference series:

  • 294 Accesses

Abstract

iTasks is a shallowly embedded monadic domain-specific language written in the lazy, functional programming language Clean. It implements the Task-Oriented Programming (TOP) paradigm. In TOP one describes, on a high level of abstraction, the tasks that distributed collaborative systems and end users have to do. It results in a web application that is able to coordinate the work thus described. Even though iTasks is defined in the common notion of “tasks”, for stake holders without programming experience, textual source code remains too difficult to understand. In previous work, we introduced Tonic (Task-Oriented Notation Inferred from Code) to graphically represent iTasks programs using blueprints. Blueprints are designed to bridge the gap between domain-expert and programmer. In this paper, we add the capability to graphically trace the dynamic behaviour of an iTasks program at run-time. This enables domain experts, managers, end users and programmers to follow and inspect the work as it is being executed. Using dynamic blueprints we can show, in real-time, who is working on what, which tasks are finished, which tasks are active, and what their parameters and results are. Under certain conditions we can predict which future tasks are reachable and which not. In a way, we have created a graphical tracing and debugging system for the TOP domain and have created the foundation for a tracing and debugging system for monads in general. Tracing and debugging is known to be hard to realize for lazy functional languages. In monadic contexts, however, the order of evaluation is well-defined, reducing the challenges Tonic needs to overcome.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 74.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Available in the latest development releases at https://clean.cs.ru.nl/Download_Clean.

  2. 2.

    All blueprints in this paper are generated from the example programs.

  3. 3.

    Clean does not have -notation, so binds are explicitly written out.

  4. 4.

    Cloogle resides at https://cloogle.org/.

References

  1. Achten, P., Stutterheim, J., Domoszlai, L., Plasmeijer, R.: Task oriented programming with purely compositional interactive scalable vector graphics. In: Tobin-Hochstadt, S. (ed.) Proceedings of the 26Nd 2014 International Symposium on Implementation and Application of Functional Languages, IFL 2014, pp. 7:1–7:13. ACM, New York (2014). https://doi.org/10.1145/2746325.2746329

  2. Andy, G.: Debugging haskell by observing intermediate data structures. Electron. Notes Theor. Comput. Sci. 41(1), 1 (2001). http://www.sciencedirect.com/science/article/pii/S1571066105805389

    Article  Google Scholar 

  3. Arisholm, E., Briand, L.C., Hove, S.E., Labiche, Y.: The impact of UML documentation on software maintenance: an experimental evaluation. IEEE Trans. Softw. Eng. 32(6), 365–381 (2006). http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=1650213&contentType=Journals+

    Article  Google Scholar 

  4. Henrix, J., Plasmeijer, R., Achten, P.: GiN: a graphical language and tool for defining iTask workflows. In: Peña, R., Page, R. (eds.) TFP 2011. LNCS, vol. 7193, pp. 163–178. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32037-8_11

    Chapter  Google Scholar 

  5. Nilsson, H.: Information: declarative debugging for lazy functional languages (1998). http://books.google.nl/books?id=nQQ9AAAACAAJ&dq=intitle:Declarative+Debugging+for+Lazy+Functional+Languages&hl=&cd=1&source=gbs_api. Science, U.i.L.D.o.C

  6. Nilsson, H., Sparud, J.: The evaluation dependence tree as a basis for lazy functional debugging. Autom. Softw. Eng. 4(2), 121–150 (1997). http://link.springer.com/10.1023/A:1008681016679

    Article  Google Scholar 

  7. Object Management Group: Business process model and notation (BPMN) version 1.2. Technical report, Object Management Group (2009)

    Google Scholar 

  8. Object Modeling Group: OMG unified modeling language specification. Technical report, March 2000. http://www.omg.org/spec/UML/1.3/PDF/index.htm

  9. Object Modeling Group: OMG unified modeling language (OMG UML), infrastructure. Technical report, March 2012. http://www.omg.org/spec/UML/2.4.1/Infrastructure/PDF/

  10. OMG: OMG unified modeling language (OMG UML), superstructure, Version 2.4.1, August 2011. http://www.omg.org/spec/UML/2.4.1

  11. Plasmeijer, R., Achten, P., Koopman, P., Lijnse, B., Van Noort, T., Van Groningen, J.: iTasks for a change: type-safe run-time change in dynamically evolving workflows. In: PEPM ’11: Proceedings Workshop on Partial Evaluation and Program Manipulation, PEPM 2011, Austin, TX, USA, pp. 151–160. ACM, New York (2011)

    Google Scholar 

  12. Plasmeijer, R., van Eekelen, M.: Clean language report (version 2.1) (2002). http://clean.cs.ru.nl

  13. Poswig, J., Vrankar, G., Morara, C.: VisaVis: a higher-order functional visual programming language. J. Vis. Lang. Comput. 5(1), 83–111 (1994). http://linkinghub.elsevier.com/retrieve/pii/S1045926X84710056

    Article  Google Scholar 

  14. Reekie, H.J.: Visual haskell: a first attempt. Technical report (1994). http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.56.1582&rep=rep1&type=pdf

  15. Reinke, C.: GHood–graphical visualisation and animation of Haskell object observations. In: 2001 ACM SIGPLAN (2001). http://www.haskell.org/haskell-workshop/2001/proceedings.pdf#page=127

  16. Sparud, J., Runciman, C.: Tracing lazy functional computations using redex trails. In: Glaser, H., Hartel, P., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 291–308. Springer, Heidelberg (1997). https://doi.org/10.1007/BFb0033851

    Chapter  Google Scholar 

  17. Sparud, J., Runciman, C.: Complete and partial redex trails of functional computations. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 160–177. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0055430

    Chapter  Google Scholar 

  18. Stutterheim, J., Plasmeijer, R., Achten, P.: Tonic: an infrastructure to graphically represent the definition and behaviour of tasks. In: Hage, J., McCarthy, J. (eds.) TFP 2014. LNCS, vol. 8843, pp. 122–141. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-14675-1_8

    Chapter  Google Scholar 

  19. White, S.A.: Business process model and notation, V1.1 pp. 1–318, January 2008. http://www.omg.org/spec/BPMN/1.1/PDF/

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Jurriën Stutterheim , Peter Achten or Rinus Plasmeijer .

Editor information

Editors and Affiliations

Appendices

A Using Tonic

In this section we will look at how to use Tonic in iTasks programs. Tonic consists of two parts: the Tonic compiler and the Tonic framework. iTasks ships with pre-configured Tonic environment files, which you can load into the Clean IDE. The Tonic environment then ensures the correct compiler is used.

Tonic uses an opt-in mechanism to determine which modules to visualize. Opting a module in is done by importing the iTasks._Framework.Tonic module. By default, importing this module will import instances for the Contained and Blueprint type classes for the following types: Task, Maybe, Either, and IO. At this point, you can also define your own instances for these classes.

In order to see the blueprints, you still need to include a path to the built-in Tonic viewer. This is done in the startEngine rule of your program, as shown in Fig. 33. The built-in Tonic viewer is exported via another module, which will need to be imported first.

Fig. 33.
figure 33

Using Tonic.

Navigating to the /tonic URL presents the user with a screen similar to Fig. 34. Two tabs on the top of the screen allow the user to choose between viewing static or dynamic blueprints. Initially, the “Static Blueprints” tab is selected. The user can browse the static blueprints by first selecting the module for which to view the blueprints. After selecting the module, a list with the task names for which a blueprint has been generated appears. Selecting a task name from that list will cause the corresponding blueprint to be rendered.

Fig. 34.
figure 34

Built-in static blueprint browser

To view runtime progress, the user can select the “Dynamic Blueprints” tab. This is shown in Sect. 4.5, Fig. 28.

B iTasks Combinators

In this appendix we list common task combinators. All of the combinators used in this paper are presented here. Additional combinators are presented as well. We encourage the reader to experiment with them. Because the iTasks system is a work in progress, it is inevitable that definitions may change in the future. Please use the dedicated search engine CloogleFootnote 4 to get access to up-to-date definitions and documentation, not only of iTasks but also of Clean and all other libraries.

1.1 B.1 Type Classes

figure gc

1.2 B.2 Step Combinator and Utility Functions

figure gd

1.3 B.3 Parallel Combinators

figure ge

1.4 B.4 Editors

figure gf

1.5 B.5 Share Combinators

figure gg

1.6 B.6 Task Assignment

figure gh

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Stutterheim, J., Achten, P., Plasmeijer, R. (2019). Static and Dynamic Visualisations of Monadic Programs. In: Zsók, V., Porkoláb, Z., Horváth, Z. (eds) Central European Functional Programming School. CEFP 2015. Lecture Notes in Computer Science(), vol 10094. Springer, Cham. https://doi.org/10.1007/978-3-030-28346-9_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-28346-9_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-28345-2

  • Online ISBN: 978-3-030-28346-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics