Claudio Sanchez wrote:

> Is there a way to load a file in hugs so that it will automatically run a
> specific function from that file?  For example, I have a script file
> called "hello".  It looks like this:
>
>   #!/usr/local/bin/hugs
>   hello :: IO ()
>   hello = putStr "Hello World!"
>
> I can "./hello" and it will load the file in hugs.  However, I have to
> type "hello" at the prompt to get the output.
>
> How can I make hugs run my hello function after loading without typing
> "hello" and is there a way for hugs to exit automatically afterwards?

You need to use `runhugs' instead of `hugs'.  `runhugs' should have been
installed in the same place as `hugs' if you used `make install' (or an
rpm).  The following script does what you want:

#!/usr/local/bin/runhugs
main = putStr "Hello World!\n"

--Jeff

Reply via email to