runghc badly broken

Niklas Broberg niklas.broberg at gmail.com
Mon Apr 18 14:33:08 EDT 2005


> 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


More information about the Glasgow-haskell-users mailing list