I've spent the better part of my morning and afternoon playing around with GUI frameworks in Haskell, as I need some visualization and interaction capabilities and I'm not in love with writing my core functionality in Haskell then piping out to a front end written in another GUI; I'd prefer to do it all from one language. The better part of that better part has been spent compiling and patching source code, or Googling obscure compilation errors.

I've spent plenty of time reading SO questions, plenty of time on haskell.org, and plenty of time reading documentation. What I've encountered is a very large swath of outdated or poorly documented information. I can boil it down to these three things:

A glut of options built on top of Gtk+ bindings. I don't care for Gtk+ very much, mostly because I find it to be quite unpleasant to look at, especially on OS X. Griping about the UI looking out of place and/or just plain ugly might seem silly, but that's important to me. Especially if I want other people to utilize any of the programs that I create.

wxHaskell, which is stable and incredibly easy to install but many of the existing tutorials seem to be for wx-0.1x and the conventions for bridging the wxWidgets 2.9.x docs to wx-0.90.x are very very spotty and hard to grok, when they even exist.

qtHaskell, which seems to be mostly abandoned (correct me if I'm wrong), only compiles with newer versions of GHC after applying a year-old patch, and spits out a massive amount of warnings that indicate they will soon become compile errors in newer versions of GHC.

In effect, I'm looking for Haskell's answer to Java's Swing; a library that is robust, maintained, well documented, easy to get started with, makes an attempt to be native in look and feel, can keep up with GHC's development pace, and not at high risk for abandonment. This seems to be exactly zero GUI frameworks, but then it seems that most of the "official" resources/wikis/pages/docs related to GUI frameworks are woefully unmaintained so I decided to turn to the community to see if there was something I just wasn't finding. I'm not terribly worried about the framework being cross platform, just so long as it works on modern versions of OS X.

To reiterate, I'm not really looking for someone to send me a link to haskell.org or the WikiBook. I've been there, and I didn't like what I saw. Most of the information there is just so out of date that it only creates more work, not less.

I realize that my "demands" are a little extreme, especially for a language with a smaller community like Haskell, but I was hoping that someone out there could be of assistance to me. In the mean time, I intend to simply try and ride out wxHaskell or qtHaskell until I succeed or die.

If I could upvote you 50 times I would. My experience in general with a lot of the neat languages is that they lack stuff like good tools for GUIs. Like you point out, that's what gets your programs used, so it's kind of a big deal. I just gave up and treat Haskell like a neat tool for experimental coding, but nothing I could do any real work in. I'd LOVE to be proven wrong.
–
RonaldBarzellDec 15 '12 at 0:10

1

Perhaps it's because people don't know how to get widget toolkits right. Not just for functional languages, but in general. Personally, I think popular ideas about GUIs have hardly progressed since the '80s, and the best way to fix it is to start by abandoning legacy notions. Let's start with widgets.
–
RhymoidDec 15 '12 at 0:24

@Tinctorius: This is intriguing. What did you have in mind?
–
RonaldBarzellDec 15 '12 at 0:26

1

I totally sympathize, but... is this a really question?
–
jberrymanDec 15 '12 at 2:33

@jberryman The title of the post was originally a question, but it was edited by the community to be turned in to the context-free clause that you see here now. That said, feel free to turn it in to community wiki if you want. I don't really need the rep. I'm just genuinely curious.
–
Doug StephenDec 15 '12 at 2:36

3 Answers
3

Threepenny-gui is the most recent contender in the space of Haskell GUI libraries.

Its main selling point is that it is very easy to install, because it uses the web browser as a display. It's also easy to get started with.

On the other hand, it doesn't even attempt to have a native look and feel – the UI is built solely on HTML. (This may change in the future, as we have the option of using XUL). Also, the API is still very much in flux, so be prepared that new major versions of the library are likely to break backwards compatibility. (On the other hand, this means that it's actively developed. :-))

(Disclosure: I'm the author / maintainer of the threepenny-gui package.)

I feel your pain; this answer is an attempt to provide some alternatives that may be good enough and perhaps help you with your search.

First, there is a language called Concurrent Clean. It is supposed to be similar to Haskell, has GUI support and is meant for writing real-world applications. It differs in some respects; for instance, its I/O is based on unique types rather than Monads, which as far as I'm concerned, is a good thing :). Here is a link:
http://wiki.clean.cs.ru.nl/Clean

Next, I dug around for a Haskell compiled to the JVM, in the hopes that it would piggy-back on the Java libraries, ala Clojure. No dice. What I did find was a SO thread discussing the lack and the challenges thereof:
Haskell on JVM?

It's sad. Here we have the JVM and .NET and yet zilch for Haskell. It's worse than that; .NET has shown an alarming tendency to ditch promising implementations. Whatever happened to IronScheme, IronLisp and IronHaskell? All dead as far as I can tell.

Frege actually looks really interesting. They note on the Google code page that they have moved to GitHub, and upon browsing their GH repo they state that they are "more or less" Haskell 2010 on the JVM. Differences outlined here: github.com/Frege/frege/wiki/… Frege also includes an Eclipse plugin. This is nice, because I'm a Java dev by day and Eclipse is my IDE of choice. All in all, this seems to be a good find. Thanks!
–
Doug StephenDec 15 '12 at 2:21

@DougStephen Keep in mind, though, that Frege is quite new and you may miss one thing or another, especially with regards to libraries. Feel free to contact the developers through google groups or use the frege tag here on SO.
–
IngoDec 18 '12 at 11:46

wxHaskell is good, yes, and my go-to GUI middle level library. I admit there's been a focus on updating the code before the docs in the new version.

For modern, functional-reactive-programming fun stuff on top of it I gor for reactive banana, which is actively maintained, and has the added benefit that Heinrich Apfelmus himself may well turn up here to answer your questions.

I've actually been looking at FRP in general for a while, because I may do my senior thesis on how functional programming, specifically FRP, can be used in simulation environments to improve dev productivity and retain decent performance (or improved via trivial concurrency). I'm going to (attempt) an implementation of Featherstone's Articulated Body solver in Haskell. Developing some reactive GUI's might be a good place to cut my teeth.
–
Doug StephenDec 18 '12 at 18:36