[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell
Subject:    Re: advice wanted on GUI design patterns
From:       Johan Nordlander <nordland () cs ! chalmers ! se>
Date:       1999-09-29 8:38:49
Message-ID: 0FIT00EGJBYZKC () ratatosk ! utfors ! se
[Download RAW message or body]

>
>Havoc Pennington wrote:
>> 
>> On Mon, 27 Sep 1999, Antony Courtney wrote:
>> >
>> > First, it is possible to write applications in Haskell using event loops
>> > and mutable state.  Most of the simple toolkit bindings (such as
>> > TclHaskell, which is really a binding to Tk) do this.
>> >
>> 
>> Is it possible to do this without implicitly keeping all your data in some
>> written-in-C component (such as the GUI components themselves)? If so,
>> how? (Because if not it's going to be a pretty huge spaghetti mess, it
>> seems to me - plus there's not much advantage to Haskell if you can't use
>> Haskell types for your data.)
>
>The Tk binding for Haskell provides for a GUI Monad that encapsulates
>performing GUI actions, and a GUIRef monad for maintaining and updating
>references to mutable state.  It's a flagrant violation of the
>functional style, but it works, and lets you use Haskell to write GUI
>applications in the same old event-driven spaghetti style we all know
>and hate.


Perhaps this is a good opportunity for me to boldly suggest a look at 
O'Haskell:

   http://www.cs.chalmers.se/~nordland/ohaskell/

This OO extension of Haskell supports the familiar encapsulation of state
within objects, but improves on the "spagetti" style by means of concurrency
and the same kind of asynchronous event-dispatching that Concurrent Haskell
also uses.  There is moreover a Tk interface and some GUI examples available.

-- Johan



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic