"A Language Based Approach to Unifying Events and Threads"

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Apr 27 19:08:58 EDT 2006


On Thu, 2006-04-27 at 16:46 -0400, Geoffrey Alan Washburn wrote:
> I don't see that anyone has mentioned yet, but I expect a number of GHC 
> users and developers will find this paper very interesting:
> 
> http://www.cis.upenn.edu/~stevez/papers/LZ06a.pdf


Indeed it is an interesting read. Just the other day a colleague was
explaining the CPS monad to me but couldn't think of any practical
applications.

I shall bear this in mind next time I think about abstractions for
programming GUIs in Haskell. Of course at a low level GUIs are event
systems and are thus a bit of a pain to code with. So if we can use
techniques similar to those in the paper we might be able to get
something nicer that allows us to use more sane control flow.

One difference between a file/network IO event system and a GUI event
system is that with IO you can make blocking calls (within the view of a
thread) waiting for one kind of event, while with a GUI one has to be
able to respond to many different events in the same context. For
example with a server we can pretend we have many conversations with
clients and each conversation consists of blocking sends & receives of
messages. With a GUI a user may interact with a multitude of different
graphical elements and yet we can't sensibly split that up into many
threads (as we can with network clients) because they share so much
common state.

Duncan



More information about the Glasgow-haskell-users mailing list