Events in Haskell, and How to Implement Them

George Russell

To appear at International Conference on Functional Programming (ICFP01), Firenze, Italy, 3-5 September 2001


Abstract

We describe a new and simpler implementation in Haskell of CML's events, which encode reactions by a thread to combinations of messages from other threads. We add a new type of Guarded Events, by which recipients can filter messages with conditions on their value known as Guards. We implement guarded channels. The guard type and the indexing algorithm are not part of the channel definition, so that the user can trade off what guards are required against the cost of indexing. As an example we sketch the encapsulation of a graphical user interface toolkit. This can be done concisely not only because of guarded events, but also because we construct events monadically. Monadic events are especially helpful for representing concurrent processes which transform themselves in reaction to external communications.


Server START Conference Manager
Update Time 11 May 2001 at 15:31:50
Maintainer Xavier.Leroy@inria.fr.
Start Conference Manager
Conference Systems