[Haskell-cafe] GUI library

Jason Dagit dagit at codersbase.com
Sat Aug 29 13:55:35 EDT 2009

On Sat, Aug 29, 2009 at 8:03 AM, Michael Mossey<mpm at alumni.caltech.edu> wrote:
> I want to choose a GUI library for my project. Some background: I'm a
> beginner to functional programming and have been working through Haskell
> books for a few months now. I'm not just learning Haskell for s**ts and
> giggles; my purpose is to write music-composition-related code; in
> particular, I want to write a graphical musical score editor. (Why write my
> own editor, you may ask? Because I want to fully integrate it with
> computer-assisted-composition algorithms that I plan to write, also in
> Haskell.) I decided to use Haskell for its great features as a functional
> programming language.
> Regarding a choice of GUI library, I want these factors:
> - it needs to provide at a minimum a drawing surface, a place I can draw
> lines and insert characters, in addition to all the standard widgets and
> layout capabilities we have to come to expect from a GUI library.
> - This is a Windows application.
> - it needs to be non-confusing for an intermediate-beginner Haskeller.
> Hopefully good documentation and examples will exist on the web.
> - It might be nice to have advanced graphics capability such as Qt provides,
> things like antialiasied shapes, and a canvas with efficient refresh
> (refereshes only the area that was exposed, and if your canvas items are
> only primitives, it can do refreshes from within C++ (no need to touch your
> Haskell code at all). However I'm wondering if qtHaskell fits my criteria
> "well-documented" and "lots of examples aimed at beginners".

I've never used it myself, but if you're going to be drawing a lot
perhaps cairo is right for you?

I suspect you'll have to be "self-taught" here.  Gtk2Hs and WxHaskell
are probably the most mature gui libs for Haskell.  Yet with either
one you may end up dropping down into GDI/GDI+ or opengl on windows to
get what you want.  GDI/GDI+ is confusing in any language, but good
books/resources do exist.  So perhaps the trick here is to translate
good documentation from other languages/sources into Haskell examples.
 You could do this as a warm up exercise before starting on your music


More information about the Haskell-Cafe mailing list