
Hi all, I'm trying to use runghc (6.4 release version, redhat linux), but it appears to be badly broken. It only processes the first argument given to it, so while ---------------------------
runghc Foo.hs hello
with Foo.hs being simply main = putStrLn "hello" --------------------------- works just fine, while for instance ---------------------------
runghc -v1 Foo.hs Loading package base-1.0 ... linking ... done.
<interactive>:1:78: Failed to load interface for `Main': Could not find module `Main': it is not a module in the current program, or in any known package. Leaving GHCi. --------------------------- manages to be 1-verbose but doesn't find the file, and ---------------------------
runghc Foo.hs -v1 hello
executes the file alright, but forgets verbosity. I can't imagine this is the intended behavior? /Niklas

I'm trying to use runghc (6.4 release version, redhat linux), but it appears to be badly broken. It only processes the first argument given to it... [snip]
As a friend pointed out to me, some of this behavior may not be so strange. Clearly, if you give arguments _after_ the specified source file, you expect these to be arguments to that source file and not to runghc itself. Thus the example ---------------------------
runghc Foo.hs -v1 hello
executes as expected, since Foo.hs makes no use of -v1. That leaves the other case, when the argument(s) is given _before_ the file argument. It's obviously possible to give flags to runghc, shown by runghc being verbose in the example ---------------------------
runghc -v1 Foo.hs Loading package base-1.0 ... linking ... done.
<interactive>:1:78: Failed to load interface for `Main': Could not find module `Main': it is not a module in the current program, or in any known package. Leaving GHCi. --------------------------- but only the first one is processed. IMHO the preferred behavior is that any arguments given before the single file argument is given to runghc itself, while any given after the file argument is given to the script in that file. Comments? /Niklas
participants (1)
-
Niklas Broberg