CS_221 Functional Programming

Haskell and Graphics

Report on the Hugs Graphics Library

The easiest way to work with the graphics library in the linux lab (without downloading the library):

  1. Insert in your .cshrc file the lines
    alias runhuggs 'runhugs -P/compsci/saturn/staff/csulrich/graphics-2.0.4/lib/x11:'
    alias huggs 'hugs -P/compsci/saturn/staff/csulrich/graphics-2.0.4/lib/x11:'
    If you work in a bash shell, then include the corresponding lines in the file .bashrc inserting = after runhuggs, huggs respectively.
  2. A sample file: HelloWorld.hs
  3. Run the sample file: runhuggs HelloWorld.hs
    Also try: huggs HelloWorld.hs and call main to obtain the same result.
  4. The difference between runhuggs and hugs:

Downloading the graphics library:

Installation instruction in linux:

  1. Unpack the tar file:
    tar -xvf graphics-2.0.4.src.tar.gz

  2. Installation:
    make -C graphics-2.0.4/lib/x11 system=Linux hugs_install=/usr/bin/hugs

    It might be necessary to replace `/usr/bin/hugs' by the actual hugs path (type `which hugs' to find out this path).

  3. Test:
    runhugs -Pgraphics-2.0.4/lib/x11: graphics-2.0.4/demos/HelloWorld.hs

  • Back to cs221
  • Back to Information for Students
  • Back to my Homepage

  • Ulrich Berger, Monika Seisenberger, 26.10.03