|
DRUM >
College of Computer, Mathematical & Natural Sciences >
Computer Science >
Technical Reports of the Computer Science Department >
Please use this identifier to cite or link to this item:
http://hdl.handle.net/1903/8400
|
| Title: | Directing JavaScript with Arrows (Functional Pearl) |
| Authors: | Khoo, Yit Phang Hicks, Michael Foster, Jeffrey S. Sazawal, Vibha |
| Type: | Technical Report |
| Issue Date: | 2-Aug-2008 |
| Series/Report no.: | UM Computer Science Department CS-TR-4923 |
| Abstract: | JavaScript, being a single-threaded language, makes extensive use of event-driven programming to enable responsive web applications. However, standard approaches to sequencing events are messy, and often lead to code that is difficult to understand and maintain. We have found that arrows, a generalization of monads, are an elegant solution to this problem. Arrows allow us to easily write asynchronous programs in small, modular units of code, and flexibly compose them in many different ways, while nicely abstracting the details of asynchronous program composition. In particular, we show how to use arrows to construct a variety of state machines, such as autoscrollers and drag-and-drop handlers. |
| URI: | http://hdl.handle.net/1903/8400 |
| Appears in Collections: | Technical Reports of the Computer Science Department
|
Files in This Item:
| File |
Description |
Size | Format | No. of Downloads |
| tr.pdf | | 286.32 kB | Adobe PDF | 1610 | View/Open |
|
All items in DRUM are protected by copyright, with all rights reserved.
|