runhugs -h1000000 foo.hs arg1 arg2runs the program foo.hs. The argument -h1000000 is used to set the heap size of Hugs and is not passed on to foo.hs, while both arg1 and arg2 are returned by the getArgs function in the System library. The program is executed by running main in module Main. Programs that do not define main cannot be executed by runhugs.
On Unix systems, executable programs may be created by placing runhugs in the first line of an executable file, like so:
#!/usr/local/bin/runhugs -h10k module Main where main = putStr "Hello, World\n"
The Hugs parser treats lines beginning with #! as comments, whether in literate or non-literate Haskell programs. Stand-alone programs can import other modules using import chasing. The runhugs program uses the same environment variables to set Hugs options as the standard Hugs systems. The stand-alone Hugs program may return an exit code.
On Windows 95/NT, runhugs may be invoked using a file extension that is set up to call runhugs rather than hugs. See hugs/docs/windows-notes.txt for details.