Niklas Hambüchen | 3 May 16:35 2013

runhaskell flags: What is going on?

> runhaskell -fno-warn-unused-matches Myfile.hs
[some compile error]

> runhaskell -fno-warn-unused-matches Myfile.hs
[no output whatsoever but exit code 127]

> runhaskell -asdf Myfile.hs
ghc: unrecognised flags: -asdf

> runhaskell -fasdf Myfile.hs
[no output whatsoever but exit code 127]

Not sure if that's how it should work or missing error reporting?

Thanks
Niklas
Brandon Allbery | 3 May 16:48 2013
Picon

Re: runhaskell flags: What is going on?

On Fri, May 3, 2013 at 10:35 AM, Niklas Hambüchen <mail <at> nh2.me> wrote:
> runhaskell -fno-warn-unused-matches Myfile.hs
[some compile error]

> runhaskell -fno-warn-unused-matches Myfile.hs
[no output whatsoever but exit code 127]

> runhaskell -asdf Myfile.hs
ghc: unrecognised flags: -asdf

> runhaskell -fasdf Myfile.hs
[no output whatsoever but exit code 127]

Not sure if that's how it should work or missing error reporting?

If you type just 'runhaskell' you will get an error message which explains what is going on. (The short version is, -f has multiple meanings; some of them apply to runhaskell, and some to the underlying ghc.)

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Niklas Hambüchen | 4 May 07:20 2013

Re: runhaskell flags: What is going on?

Not sure what you mean; if I just run `runhaskell`, it reads from stdin.

In any way, if runhaskell exits with error code 127, should it not 
print what the error is?

On Fri 03 May 2013 22:48:33 SGT, Brandon Allbery wrote:
> If you type just 'runhaskell' you will get an error message which
> explains what is going on. (The short version is, -f has multiple
> meanings; some of them apply to runhaskell, and some to the underlying
> ghc.)
Brandon Allbery | 4 May 17:05 2013
Picon

Re: runhaskell flags: What is going on?

Bleh, I could have sworn that thing had a real usage message at some point...​ which means there is in fact a problem and you should file a bug against runhaskell.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Albert Y. C. Lai | 4 May 23:26 2013
Picon

Re: runhaskell flags: What is going on?

On 13-05-03 10:35 AM, Niklas Hambüchen wrote:
>> runhaskell -fno-warn-unused-matches Myfile.hs
> [no output whatsoever but exit code 127]
>
>> runhaskell -fasdf Myfile.hs
> [no output whatsoever but exit code 127]

$ runghc --help
Usage: runghc [runghc flags] [GHC flags] module [program args]

The runghc flags are
     -f /path/to/ghc       Tell runghc where GHC is
     --help                Print this usage information
     --version             Print version number

# how to say end of runghc flags and start of GHC flags?
# it seems undocumented. bad bad bad.
# oh wait, it is documented, read GHC user's guide chapter 3
# actually, read the whole thing
# the GHC user's guide is on your hard disk

$ cat g.hs
main = putStrLn "hello" where v=True

$ runghc -- -fwarn-unused-binds g.hs

g.hs:1:31: Warning: Defined but not used: `v'
hello

# \∩/

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane