[Haskell-cafe] Building GUIs for Haskell programs

Dmitri Pissarenko mailing-lists at dapissarenko.com
Wed Jan 12 09:30:49 EST 2005


> I don't think there is a simple answer.  It probably depends on your
> experience, your development platform, and where you want to be able to
> distribute your application to.

My goal behind experimenting with Haskell-based GUIs is to determine whether
UI development in Haskell is much "better" (for instance, simpler, testable,
maintainable) than in an imperative language.

Up to now I have the impression that there are lots of things, which one can
do in Haskell easier than in an imperative language.

IMO user interfaces are very hard to test in imperative language. One needs to
be very disciplined in order to test the behaviour of UIs thoroughly. It is
possible, for instance, using the Abbot framework in Java, but it requires so
much effort that, in most cases, I

a) either don't write the test case for a UI behaviour, or
b) write a test case on the "non-UI" part, which would fail, if the UI
behaviour would work in a wrong way.

For instance, imagine you want to test that a table contains value X in row Y
and column Z. You can display this table, then navigate to the cell in the
table and look what value is displayed there. This is hard. In most cases, I
test the component, which is responsible for providing data for display (in
Java they are called table models). A table model is just a class, which you
can test with plain JUnit without any special extensions.

So I want to try to write a GUI in Haskell and then decide whether writing
GUIs in Haskell is really much better than writing them in an imperative

Best regards

Dmitri Pissarenko
Dmitri Pissarenko
Software Engineer

More information about the Haskell-Cafe mailing list