It is possible to install support for Gtk-2 and for Gtk-3 on the same computer.
The installation of support for Gtk-2 is done with:
sudo apt-get install libghc-gtk-dev
The corresponding documentation can be installed with:
sudo apt-get install libghc-gtk-doc
On systems that have both Gtk-2 and Gtk-3 for Haskell installed, you have to tell the compiler which module it should use. There are two ways to do that:
It is possible to mention the package to be used in the import-clause of a module. To do this, one replaces the simple import -clause
import Graphics.UI.Gtk
with this one:
import "gtk3" Graphics.UI.Gtk
When the development framework cabal is used to compile a program, the packages to be used are specified in the build information file that manages compilation.