TclHaskell

Tk/Tcl is a great way of scripting together components, in particular for user interfaces. TclHaskell is a library for accessing these abilities through Haskell. It was orginally developed by Chris Dornan, but he has since left Academia. TclHaskell is now looked after by Meurig Sage.


For a more powerful and declarative GUI library, built on top of TclHaskell, have a look at FranTk.


TclHaskell is a library of functions for writing platform independent, graphical user interfaces in the lazy and pure functional programming language Haskell. The library provides a convenient, abstract and high-level way to write window-oriented applications. It also provides a more low level interface to write primitive Tcl code where helpful.

TclHaskell was originally based on TkGofer .

There is an online user manual available. There are a large number of demos available with the release itself. The html in this manual was created with Microsoft Word, and so has some Microsoft specific stuff in it. An alternative is to use the following pdf format manual.

TclHaskell works with Haskell 98, and has been tested under hugs 98 and ghc-4.08. (It uses an HDirect generated interface to communicate with tcl-tk.)

TclHaskell has been tested with Tcl 8.0. This is available from http://www.scriptics.com.


To get TclHaskell working with ghc binary releases on windows, there are some problems. Look here for the solution.

If you're compiling under linux, then you'll need to add -ldl and remove the -static from the makefile options when compiling the demos executable.

On windows there is one further gotchas.

1 On Windows 95/98 you may still get a warning like "ERROR "c:\Hugs98\TclHaskell\src\TclPrim.hs": Error while importing DLL "c:\HUgs98\TclHaskell\src\TclPrim.dll". If so it's probably because hugs can't find the Tcl dlls to load. These live in the Tcl\bin directory. If you've got the right version of Tcl & your system is not finding them, make sure that the directory that they are in is on your path. If you're still having problems try copying them to the same directory that TclPrim.dll is in.


Current release

Here is the latest TclHaskell distribution (version 1.2). (Updated 3 October 2001). It has been tested with ghc-5.00.2 and ghc-5.02.
In tar gzip format.

(This is a slight update from the version released on 27 September. The windows makefiles have been altered to allow it to work with ghci on windows).


Older releases

Here is the earlier TclHaskell1_1 release (March 2001).
In tar gzip format.
In windows zip format.

Here is the original TclHaskell distribution (version 1.0). (Released August 1999.)
In tar gzip format. (This has makefile for solaris,linux, and NT)
In window zip format. (This has a makefile for NT, and all files are in NT end of line format.)


meurig@dcs.gla.ac.uk