
Draft Proceedings of the Sixth Advanced Functional Programming school (AFP 2008) May 19-24 2008 Center Parcs “Het Heijderbos” The Netherlands Edited by Pieter Koopman Rinus Plasmeijer Doaitse Swierstra Technical report: ICIS- R08008, May, Radboud University Nijmegen, 2008 Preface The 6th Advanced Functional Programming school (AFP 2008) is being held in Center Parcs “Het Heijderbos,” The Netherlands near the city of Nijmegen on May 19-24, 2008. It is co-located with the 9th Symposium on Trends in Functional Programming (TFP 2008). The co-location of these two events is intended to attract new researchers to the exciting area of functional programming. TFP 2008 is organized by the Computer Science Department of the Radboud University Nijmegen and Utrecht University. The goals of the Advanced Functional Programming schools are: • Bring computer scientists, in particular young researchers and programmers, up to date with the latest functional programming techniques. • Use advanced functional programming techniques in "programming in the real world". • Bridge the gap between results presented at programming conferences and material from introductory textbooks on functional programming. The approach we take to achieve these goals in the schools is: • In depth lectures about a selected number of advanced functional programming techniques that emerged or established recently. The lectures are taught by experts in the field that actively contribute to research and application of the techniques. • Lectures are accompanied by practical problems to be solved by the students at the school. The problems guide the students' learning to a great extent. This implies that there has to be a lab at the school site. After the popularization of the laptop and WiFi, this can be almost anywhere. • Group work is stimulated, especially because the practical problems will typically be too large for a single person. By functional programming we mean programming in a style that emphasizes the evaluation of expressions rather than the execution of commands. This proceedings represents the papers associated with the lectures presented at AFP 2008. As in previous versions of AFP it is called the draft proceedings to distinguish it from the formal peer- reviewed post- proceedings that will be published as a LNCS volume by Springer. AFP 2008 gratefully acknowledges the generous support of Getronics Pink Roccade, The Nederlandse Organisatie voor Wetenschappelijk Onderzoek (NWO), the Netherlands Defence Academy and the Radboud University Nijmegen. We are particularly grateful to the lectures of this summer school. Peter Achten, Pieter Koopman, Simone Meeuwsen, Rinus Plasmeijer, and Doaitse Swierstra. Nijmegen, The Netherlands May 2008 i School Organisation Editors: Pieter Koopman, Rinus Plasmeijer (both Radboud University Nijmegen, NL), Doaitse Swierstra (Utrecht University, NL) Local arrangements: Peter Achten, Pieter Koopman, Simone Meeuwsen (all Radboud University Nijmegen, NL) Support www.getronics.com www.nwo.nl www.nlda.nl www.cs.ru.nl ii Program Monday Tuesday Wednesday Thursday Friday Saturday Morning 1 Mark Jones Richard Bird Ulf Norell Johan Jeuring Simon Peyton Umut Acar 8:30-10:15 Jones & Satnam Singh Morning 2 Rinus Ulf Norell Richard Bird Olivier Danvy Umut Acar Simon Peyton 10:45-12:30 Plasmeijer Jones & Satnam Singh Lunch 12:30-14:00 Afternoon 1 Mark Jones Mark Jones Ulf Norell Johan Jeuring Olivier Danvy Umut Acar 14:00-15:45 Afternoon 2 Rinus Rinus Richard Bird Olivier Danvy Johan Jeuring Simon Peyton 16:15-18:00 Plasmeijer Plasmeijer Jones & Satnam Singh Table of contents I. Rinus Plasmeijer .................................................................................................................... 7 Specifying interactive workflows for the web II. Richard Bird ........................................................................................................................ 48 Spider spinning for dummies III. Ulf Norell ............................................................................................................................ 73 Dependently typed programming in Agda IV. Johan Jeuring .................................................................................................................... 106 Libraries for Generic Programming in Haskell V. Olivier Danvy .................................................................................................................... 171 From reduction-based to reduction-free normalization VI. Umut Acar......................................................................................................................... 197 Self-Adjusting Computation VII. Simon Peyton Jones & Satnam Singh ................................................................................ 212 Parallel Functional Programming iii iv Specifying Interactive Work Flows for the Web Rinus Plasmeijer, Peter Achten, Pieter Koopman, Bas Lijnse, and Thomas van Noort Radboud University Nijmegen, Netherlands frinus,P.Achten,pieter,b.lijnse,[email protected] Abstract. In these lecture notes we present the iTask system: a set of combinators to specify workflows in a pure functional language at a very high level of abstraction. Workflow systems are automated systems in which tasks are coordinated that have to be executed by either hu- mans or computers. The combinators that we propose support workflow patterns commonly found in commercial workflow systems. In addition, we introduce novel workflow patterns that capture real world require- ments, but that can not be dealt with by current systems. Compared with most of these commercial systems, the iTask system o®ers several further advantages: tasks are statically typed, tasks can be higher order, the combinators are fully compositional, dynamic and recursive work- flows can be speci¯ed, and last but not least, the speci¯cation is used to generate an executable web-based multi-user workflow application. With the iTask system, useful workflows can be de¯ned which cannot be ex- pressed in other systems: a work can be interrupted and subsequently directed to other workers for further processing. The iTask system has been constructed in the programming language Clean, making use of its generic programming facilities, and its iData toolkit with which inter- active, thin-client, form-based web applications can be created. In all, iTasks are an excellent case of the expressive power of functional and generic programming. 1 Introduction Workflow systems are automated systems that coordinate tasks. Parts of these tasks need to be performed by humans, other parts by computers. Automation of tasks in this way can increase the quality of the process, as the system keeps track of tasks, who is performing them, and in what order they should be per- formed. For this reason, there are many commercial workflow systems (such as Business Process Manager, COSA Workflow, FLOWer, i-Flow 6.0, Sta®ware, Websphere MQ Workflow, and YAWL) that are used in industry. If we investi- gate contemporary workflow systems from the perspective of a modern functional programming language such as Clean and Haskell, then there are a number of salient features that functional programmers are accustomed to that appear to be missing in workflow systems: { Workflow situations are typically speci¯ed in a graphical language, instead of a textual language as typically used in programming languages. Functional 7 programmers are keen on abstraction using higher order functions, generic programming techniques, rich type systems, and so on. Although experi- ments have been conducted to express these key features graphically (Vital [11], Eros [7]), functional programs are typically speci¯ed textually. { Workflow systems mainly deal with control flow rather than data flow as in functional languages. As a result, they have focussed less on expressive type systems and analysis as has been done in functional language research. { Within workflow systems, the data typically is globally known and accessi- ble, and resides in databases. In functional languages, data is passed around between function arguments and results, and is therefore much more local- ized. Given the above observations, we have posed the question if, and which, func- tional programming techniques can contribute to the expressiveness of workflow systems. In these lecture notes we show how web-applications with complex control flows can be constructed by presenting the iTask system: a set of combi- nators for the speci¯cation of interactive multi-user web-based workflows. It is built on top of the iData toolkit, and both can be used within the same program. The library covers all known workflow patterns that are found in contemporary commercial workflow tools [21]. The iTask toolkit extends these patterns with strong typing, higher-order functions and tasks, lazy evaluation, and a monadic style of programming. Its foundation upon the generic [13, 1] features of the iData toolkit yields compact, robust, reusable and understandable code. Workflows are de¯ned on a very high level of abstraction. It truly is an executable speci¯cation, as much is done and generated automatically. As a running example, we will study the architecture of a conference manage- ment (CM) systems, and implement a small prototype. CM is a good case study of a workflow because it controls the activities of people with various roles, such as program chairs and program committee members. It is also challenging be- cause many of these activities run in parallel, and the system should not hamper
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages244 Page
-
File Size-