Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hey! I have installed hugs on Ubuntu 10.10 But now I have the problem how to run it. Before, I mean in later versions of Ubuntu I typed just sudo run hugs and it worked. Now it doesnt work.

How should I run hugs in Ubuntu 10.10?


share|improve this question
up vote 2 down vote accepted

You can run an interactive haskell interpreter with the hugs command or you can execute a haskell program in a file with the runhugs command - to execute a file called file.hs, enter runhugs file.hs.


alt text

Here I created a simple hello world program (You will probably want to use an actual text editor like Gedit for this; I used cat cause I'm l33t) then tried to run it with hugs but realised that this only launched the interactive session .

This may be very useful for you (and it has wonderful ASCII art) but I wanted to execute my haskell file so I consulted the manpage of hugs and found that I needed to use runhugs for this. When I used the runhugs command it executed my program and printed a "Hello, World!" message.


Why were you using sudo run hugs? There is no command called run and using sudo to run a programming environment could be very dangerous - it allows you to do anything to your system. Only use sudo when absolutely necessary.

share|improve this answer
oh...wait. I am a new one in Ubuntu. So, to run haskell I need to type in terminal the runhugs ...(the place where my haskell programms are stored and the name of them file).hs it doesnt work as well.It tells me "error-undefined variable "main"", even though I dont have such a variablen in my haskell code – user8024 Dec 28 '10 at 22:39
I got it. Thanks=) – user8024 Dec 28 '10 at 22:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.