Haskell Arrows and GUIs
Today I re-read
John Hughes' paper introducing "Arrows", and then read
Courtney and Elliott's paper
"Genuinely Functional User Interfaces", about
"Fruit", a Functional Reactive User
Interface Toolkit.
The former paper describes a generalization of monads.
If monads were already too esoteric for you, then Arrows
will be just one level worse. However, they do permit the
some programs to be expressed in a more functional style
than were possible without them.
The latter paper builds upon
some of the ideas from Paul Hudak's book
Haskell School of Expression (most notably the idea of
expressing GUI events as "signals", mappings from a Time to
a Maybe type, where the Maybe type has a value for the times
when an event occurs, and has no value for other times).
This paper then describes an Arrow-based GUI toolkit.
This sure looks to me like the most promising way for pure
functional programs to embrace GUI elements. Unfortunately,
the tower of software that their current implementation is
built on (Haskell, an FFI, GreenCard, Java2D, the Java JNI,
and the homegrown libraries Elijah and Haven)
looks mighty rickety for now. Applause for going with something
relatively portable (Java) despite Elliott's Microsoft
affiliation. Near the end of their paper, they write:
We refer to Fruit as a "prototype" only because
it does not yet include a complete set of user interface components.
Our focus thus far as been on [...]
On my copy of the paper, I scrawled the following comment:
other reasons to call it a "prototype": too much
dependence on too many underlying software packages, and
too many homegrown layers; portability questions;
installation issues ...
I'd be pleasantly surprised to find these not to be very
big issues, but years of experience with GNU Tentacles
leave me skeptical.
6:05:18 PM