[Haskell] New Version of my Arrows GUI Library Based on GTK+
Kevin Atkinson
kevina at cs.utah.edu
Tue Mar 22 11:39:32 EST 2005
I just posted a new version of FG, my Arrows GUI Library Based on GTK+.
You can find it at http://kevin.atkinson.dhs.org/fg/. I reworked how
Events are handled which decreases the number of times a loop is
traversed form "2^d" to "d + 1" where d is the depth of the inner most
loop. Furthermore only the loop which the event was fired in will need to
be traversed multiple times.
You can find it at http://kevin.atkinson.dhs.org/fg/.
Feedback appreciated.
Here are some interesting parts from the documentation:
Description:
This module is a first attempt of using Arrows to create a GUI Library
based on GTK+. A good understanding of how Arrows work is required in
order to understand the interface. For more information on Arrows see
http://www.haskell.org/arrows/.
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.
...
Implementation Notes:
Arrows essentially build up a huge tree like data structure representing
the control flow between arrows. In the current implementation most of
top-level structure has to be traversed when ever an event is fired --
even if absolutely no actions need to be taken. When a loop is used parts
of this structure may be traversed multiple times. In particular the inner
most loop where an event was fired from will be traversed "d + 1" times
where d is the depth of the loop. If an event was not fired inside a loop
(or any of the sub loops) than the loop will only be traversed once.
Avoiding this problem of having to traverse most of tree for every event
requires information that I'm not sure the compiler can give me. For
example I need to know the difference between arr (x -> x) and arr (_ ->
10). The first passes the input to the output the second throws the value
away. All I am able to know is that arr was used. What exactly the
function does is a black box.
--
http://kevin.atkinson.dhs.org
More information about the Haskell
mailing list