From HaskellWiki
Revision as of 12:50, 8 May 2009 by M (talk | contribs) (Examples)

Jump to: navigation, search

Using an algebraic data types structure and field names, this library constructs widgets for wxHaskell. It can handle data types with single or multiple constructors, as well as recursive data types.

The library is designed to integrate smoothly with wxHaskell. First, by making it easy to integrate WxGeneric-widgets into existing wxHaskell programs. Second, by letting a user extend WxGeneric using mostly wxHaskell function.


Download and Install

Before installing WxGeneric you need:

You can get the sources either from hackage or from WxGeneric's Darcs repository:

darcs get http://code.haskell.org/WxGeneric/

After getting the sources do:

cd WxGeneric
runhaskell Setup clean
runhaskell Setup configure --user --prefix=$HOME
runhaskell Setup build
runhaskell Setup install

Then you is ready to try the examples, see <path to WxGeneric>/examples.


You can find plenty of examples in the WxGeneric examples folder. Especially, you can find many small examples are found in Examples.hs in WxGeneric/Examples folder.


One nice feature of WxGenerics is that it handles recursive data types. For example:

data MyTree = Branch { left :: MyTree, right :: MyTree }
            | Leaf Int Double
              deriving Show

will produce a editable widget, such as:

MyTree Example

Contact Information

Questions, ideas or comments should be directed to wxHaskell-users mailing list. If messages are of a more private nature, you can contact me, the auther of WxGenerics, at Mads Lindstrøm.

There is also a Bug and feature request -tracker here.