- let
- (ghc_args, rest) = break notArg args
- --
- case rest of
- [] -> dieProg "syntax: runghc [-f GHCPATH] [GHC-ARGS] FILE ARG..."
- filename : prog_args -> do
- res <- rawSystem ghc (
- "-ignore-dot-ghci" : ghc_args ++
- [ "-e","System.Environment.withProgName "++show filename++" (System.Environment.withArgs ["
- ++ concat (intersperse "," (map show prog_args))
- ++ "] (GHC.TopHandler.runIOFastExit (Main.main Prelude.>> (Prelude.return ()))))", filename])
+ let (ghc_args, rest) = break notArg args
+ case rest of
+ [] -> dieProg "syntax: runghc [-f GHCPATH] [GHC-ARGS] FILE ARG..."
+ filename : prog_args -> do
+ let expr = "System.Environment.withProgName " ++ show filename ++
+ " (System.Environment.withArgs " ++ show prog_args ++
+ " (GHC.TopHandler.runIOFastExit" ++
+ " (Main.main Prelude.>> Prelude.return ())))"
+ res <- rawSystem ghc (["-ignore-dot-ghci"] ++ ghc_args ++
+ [ "-e", expr, filename])