[an error occurred while processing this directive]

Programming Language Theory
EDA145/DATN19 VT 2009

logo

Running hugs on efd

You can start Hugs with
      >  /usr/local/cs/bin/hugs
    
initcs will make it availble by a simple
      > hugs
    

If you prefer to run it under emacs you have to instruct emacs to execute some commands when it opens a Haskell file. The file hs-mode.el contains the commands. They are written using a special Lisp dialect; Most of emacs is implemented in this language.

  1. Create a file ".emacs" in your home directory. If you already have one it should be safe to add commands at the beginning of the file. Emacs will execute theses commands when it starts.
  2. It is convenient to have all .el files in a special directory, e.g. ~/lib/emacs. Put hs-mode.el there.
  3. You have to tell emacs that it should look for .el files in this directory, and load this particular file when you enter the haskell mode with ALT-X hs-mode (or ESC X hs-mode). You can even instruct emacs to enter the haskell mode automatically when you open a file with a name ending with ".hs".

    Add the following lines to the beginning of your .emacs file.

    	  (add-to-list 'load-path "~/lib/emacs")
    	  (autoload 'hs-mode "hs-mode"
    	  "Major mode for editing Haskell files."  t)
    	  (add-to-list 'auto-mode-alist '("\\.hs$" . hs-mode))
    	
    If you are using emacs then keep it open after saving the file. Then it is easer to correct misprints.

  4. Start a new emacs instance and open a file with the extension ".hs". A Haskell menu should appear where you can start Hugs and load files.
  5. If emacs cannot find hugs you have to change the shell environement variable PATH to include the directory where the hugs binary resides or change the value of the variable hs-file-name in the hs-mode.el file to the full path name of hugs.

Running ghci

If you are familiar with the Glasgow Haskell interpreter ghci there is no reason not to use it.

© cs.lth.se 2009. Maintained by Lennart Andersson
Modified: 2009-03-18