workaround found, pipe it through ghci Re: [Haskell-cafe] -f flag to runghc broken, or is it just me? (because trying switch elegantly between ghc 6.6 and ghc 6.7)

Thomas Hartman thomas.hartman at db.com
Wed Aug 22 14:03:00 EDT 2007


this works. now if only there were a "quiet" option for ghci...

well, for me, I guess this may be goodbye to poor sad undocumented 
malfunctioning runghc..

hartthoma at linuxpt:~/personal/PersonalRepos/pharchive/learning/haskell/UnixTools/arghandling>echo 
":main 1 2 3" | /usr/local/bin/ghci-6.6.1 arghandling-nice.hs
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6.1, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( arghandling-nice.hs, interpreted )
Ok, modules loaded: Main.
*Main> Loading package haskell98 ... linking ... done.
"1 2 3"
*Main> Leaving GHCi.





Thomas Hartman <thomas.hartman+external at db.com> 
Sent by: haskell-cafe-bounces at haskell.org
08/22/2007 01:38 PM

To
"haskell-cafe at haskell.org" <haskell-cafe at haskell.org>
cc

Subject
[Haskell-cafe] -f flag to runghc broken, or is it just me? (because trying 
switch elegantly between ghc 6.6 and ghc 6.7)







I'm doing a lot of switching between ghc 6.6 and ghc 6.7 on the same 
computer. I install modules using 

  $ runghc Setup.hs configure 
    etc. 

I would like to specify which version of ghc should be getting the package 
installed via the f flag to runghc 

  $ 
:~/personal/PersonalRepos/pharchive/learning/haskell/UnixTools/arghandling>runghc 

  runghc: syntax: runghc [-f GHCPATH] [GHC-ARGS] FILE ARG... 

but this appears to be broken. 

  $ 
:~/personal/PersonalRepos/pharchive/learning/haskell/UnixTools/arghandling>runghc 
arghandling-nice.hs 
  arghandling-nice.hs: args length does not equal 3. args: : [] 
  usage example: $ runghc arghandling-nice.hs firstarg secondarg thirdarg 

without the flag works but 

  $ 
:~/personal/PersonalRepos/pharchive/learning/haskell/UnixTools/arghandling>runghc 
-f /usr/local/bin/ghc-6.6.1  arghandling-nice.hs 

does nothing. 

$ 
:~/personal/PersonalRepos/pharchive/learning/haskell/UnixTools/arghandling>ls 
-l /usr/local/bin/ghc-6.6.1 
-rwxr-xr-x 1 root root 151 2007-06-16 20:22 /usr/local/bin/ghc-6.6.1 

In general I don't like using runghc because it doesn't appear to be 
documented anywhere except that (incorrect?) usage message. Is there a way 
to do a package install just using ghc -e? (Sure I could compile, but it 
helps me sometimes if I can not, a la runghc.) At any rate I couldn't 
figure out how to pass arguments to main via ghc -e. 



  $ 
:~/personal/PersonalRepos/pharchive/learning/haskell/UnixTools/arghandling>cat 
arghandling-nice.hs 
  import System 

  main = do args <- getArgs 
          let usagemsg = "usage example: $ runghc arghandling-nice.hs 
firstarg secondarg thirdarg" 
          case args of 
            [first,second,third] -> process first second third 
            _                    -> error $ "args length does not equal 3. 
args: : " ++ ( show args ) ++ "\n" ++ usagemsg 

  process a b c = print $ unwords [a,b,c] 

Thanks for anybody who can help me out with this. 

Thomas. 
---

This e-mail may contain confidential and/or privileged information. If you 

are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070822/845e549f/attachment-0001.htm


More information about the Haskell-Cafe mailing list