[Haskell-beginners] Compiling

Daniel Fischer daniel.is.fischer at web.de
Fri Jun 25 05:09:16 EDT 2010

On Friday 25 June 2010 07:34:29, Chris Saunders wrote:
> First, thanks for the reply Daniel.  I just wanted to add that I needed
> to use the command line "ghc --make hello.hs.  I first tried "ghc --make
> hello hello.hs" and this didn't work.

If you want to redirect the output, the option is '-o',

ghc --make -o hithere hello.hs

(you needn't specify the extension, ghc --make -o hithere hello works too 
[or ghc --make hello -o hithere, order of command line arguments doesn't 
matter]), if no '-o' option is given, GHC defaults to the same name for the 
binary as the main module [on Windows, name.exe].

> The second is closer to the
> command line that I used when I had the case error in the source code.
> Regards
> Chris Saunders

More information about the Beginners mailing list