WxHaskell
What is it?
wxHaskell is a portable and native GUI library for Haskell. The goal of the project is to provide an industrial strength GUI library for Haskell, but without the burden of developing (and maintaining) one ourselves.
wxHaskell is therefore built on top of wxWidgets – a comprehensive C++ library that is portable across all major GUI platforms; including GTK, Windows, X11, and MacOS X. Furthermore, it is a mature library (in development since 1992) that supports a wide range of widgets with the native look-and-feel.
The current version of wxHaskell supports wxWidgets 3.2.
Status
The core interface of wxHaskell was originally derived from the wxEiffel binding. Work on this has been dormant for several years, but the wxHaskell maintainers now support updates to the wxWidgets API themselves.
There are four key components of wxHaskell from version 0.90 onwards (three in earlier branches).
- wxdirect parses specially written C headers and generates low level Haskell FFI bindings for the exported functions.
- wxc is a C language binding for wxWidgets. It is needed because the Haskell FFI can only bind to C as it does not understand C++ name mangling. Because it is a C language wrapper over wxWidgets, and is generated as a standard dynamic library on all supported platforms, wxc could be used as the basis for a wxWidgets wrapper for any language which supports linking to C (so that would be all of them then). In older versions of wxHaskell, the wxc components were built as a monolithic static library with wxcore.
- wxcore is a set of low-level Haskell bindings to wxc. A large part is generated automatically by wxdirect, with some key abstractions being hand-coded in Haskell. You can program directly to the wxcore interface if you wish (it is sometimes the only way, in fact).
- wx is a set of higher-level wrappers over wxcore. It is intended to make it easier to write reasonably idiomatic Haskell. Most wxHaskell software is about 80% wx and 20% wxcore.
The C wrapper is, unfortunately, generated by hand, so there is some (mainly tedious boilerplate) work involved in porting a new set of widgets to wxHaskell. Some work has been done into automating this aspect, but we are far from being able to replicate the approach reliably over then entire API as yet.
From the perspective of the user (rather than the developer) about 90% of the core wxWidgets functionality is already supported, excluding more "exotic" widgets like dockable windows. The library supports Windows, GTK (Linux) and macOS X.
News
- 10 June 2024
- wxHaskell is updated to work with new tools/dependencies versions. The source repository was moved to [1], and a release is coming soon.
- 28 April 2017
- wxHaskell 0.92.3 is released.
- 30 December 2015
- wxInstall Achelanne 0.1 and wxHaskell 0.92.2 are released.
- 9 October 2015
- wxInstall Abriline packages and wxHaskell 0.92.1 are released.
- 27 August 2015
- wxHaskell 0.92.0 is released.
- 12 August 2014
- wxHaskell 0.91.0 is released. This version accepts wxWidgets 2.9 and 3.0.
- 21 March 2014
- wxHaskell 0.90.1 is released.
See also Old wxHaskell news
Documentation
- Screenshots
- Samples ( the links to the source code on that page are broken, but you can see the sources here )
- Applications
- Using wxHaskell
- License
- Quick start
- FAQ
- Short guide
- Tips and tricks
- Index of the wx API documentation
- Index of the wxcore API documentation
- The hierarchy of the C++ classes of wxWidgets, as mapped in wxHaskell
- Download
- Building and installing. Please refer to your platform.
- Development
- Contribute
Resources
- Tickets for bugs and feature requests
- Old tickets, to be imported in the new tracker
- Pull requests
- The old developer mailing list (wxhaskell-devel) (archive)
- The old wxHaskell users mailing list (wxhaskell-users) (archive)
- The wxHaskell repository, as of 10 Jun 2024 replacing the GitHub repos below
- The old wxHaskell repository, as of 2 Aug 2013 replacing the old repo and temporary maintenance repo on GitHub
External links
- Daan Leijen: wxHaskell - A Portable and Concise GUI Library for Haskell
- Wei Tan: GUI programming with wxHaskell (pdf)
- Assignment 1 part of the course (Web Archive)
- Advanced Functional Programming, by Koen Lindström Claessen and Björn Bringert, a portal like page (html)
- Blog articles about wxHaskell
- Questions about wxHaskell on Stack Overflow
- Sander Evers, Peter Achten, and Jan Kuper: A Functional Programming Technique for Forms in GUI (PDF, from the Web Archive)
- FunctionalForms, a combinator library/domain specific language for wxHaskell which enables a very concise programming style for forms (not maintained since 2005)
- Learning by Example Beginners: a Text Editor
- Learning by Example Intermediate: Custom controls
See also
- The reverse dependencies list for wx
- An example of how to implement a basic notepad with wxHaskell
- Reducing linking and startup times
- Modified Paint.hs example to show wxGCDC and graphics path drawing in action.
- The Haskell wikibook GUI chapter
- WxGeneric
- wxFruit
- Can GUI Programming Be Liberated From The IO Monad
- Phooey: a purely functional layer on top of wxHaskell
- GuiTV: GUI-based tangible values & composable interfaces, on TV, Phooey and wxHaskell.
- wxAsteroids: a game demonstrating wxHaskell.
- GeBoP: the General Boardgames Player, offers a set of board games: Ataxx, Bamp, Halma, Hex, Kram, Nim, Reversi, TicTacToe, and Zenix.
- Haskell-BlackBoard: a drawing application for making slideshows and videos, based on wxHaskell and Functional Reactive Programming
- reactive-banana - FRP library with bindings to wxHaskell.
- wxHaskell for the web: a port of a subset of wxHaskell to the web browser.
- wxHaskell Drag and Drop example (Stack Overflow)
- The package binding-wx; binds mutable data and lists to wxHaskell widgets.
- Application screenshots
- Dazzle (see also Haskell Ready to Dazzle the Real World (PDF))
- Unifying Theories of Programming Theorem Prover U·(TP)2
- Protein Secondary Structure Alignment Tool - performs a probabilistic alignment of predicted secondary structures, and generates HTML output