[Haskell] Arrows GUI Library Based on GTK+

ross at soi.city.ac.uk ross at soi.city.ac.uk
Sat Mar 19 07:17:32 EST 2005

On Fri, Mar 18, 2005 at 07:18:29PM -0700, Kevin Atkinson wrote:
> What follows is my first attempt of using Arrows to create a GUI Library 
> based on GTK+.  It uses many ideas from Fruit (http://haskell.org/fruit/). 
> However it is based on discrete events rather than a continuous signal. 
> The interface is only updated during an Event. It also ideas from Fudgets 
> (http://www.md.chalmers.se/Cs/Research/Functional/Fudgets/), some of which 
> were also used by Fruit.  

The implementation of Fruit is also based on discrete events,
though the abstract description talks about continuous signals.

Your module uses the arrow interface, but it's actually equivalent to
monads.  I don't know if this is the source of the multiple traversals,
but you may wish to experiment with synchronous stream arrows like
Automaton transformer in the experimental arrow transformer library
linked from the arrows page, or an asynchronous Fudgets-like arrow
(see John's original paper).

Some more minor suggestions:
- how about: data Event a = NoEvent | Event a
- you don't really need mkAFunDef in AbstractFunction, and indeed you
  don't need AbstractFunction either -- you could just use Arrow, of
  which both (->) and FG are already instances.
- you could make FG, FG', EntryP newtypes instead of using the !
- ArrowDef isn't arrow-specific: it could be called something like
- I'd suggest making Container a newtype, so it could have an Arrow
  instance (it would be a reader arrow).  Then hbox and vbox could be
  used as arrow operators/combinators.

More information about the Haskell mailing list