The error message you're getting is literally correct - if not particularily
informative.  Loading your program into (interactive) Hugs, I get:

[banner and loading info deleted]
                   
Hugs session for:
/home/reid/share/hugs/lib/Prelude.hs
/home/reid/share/hugs/lib/System.hs
Ls.lhs
Type :? for help
Main> main
<<IO action>>

Notice that I can't execute Main.main because it doesn't have type "IO ()".
So now I add the type signature "main :: IO ()" and try again and things
work perfectly under both Hugs and runhugs.

Incidentally, there's no need to call your program "Ls.lhs" if you don't
want to.  Adding +l to the end of the first line tells runhugs to assume
that the file is a literate script and you can rename the file to "ls"
if you like.

Alastair

> [EMAIL PROTECTED] reports the following problem.
> 
> Version:       Hugs 1.4 January 1998 
> OS:            x86 Linux 
> compiler:      gcc 
> configuration:  
> Expected behaviour:
> runhugs should execute "system" as interactive hugs does
> Observed behaviour:
> Some kind of internal error
> 
> Transcript:
> $ ./Ls.lhs
> runhugs: lookupName: can't create Typeable instance
> 
> Code:
> #!/usr/bin/runhugs
> 
> > import System
> 
> > main =
> >   do
> >     args <- getArgs
> >     let args' = "ls":args
> >     let s = unwords args'
> >     status <- system s
> >     exitWith status
> 
> 
> 




Reply via email to