[Haskell-cafe] apparent minor bug in "Getting started" tutorial at "Haskell Hacking: a journal of Haskell programming"

Benjamin L.Russell DekuDekuplex at Yahoo.com
Wed Aug 27 03:22:56 EDT 2008


This is just a minor documentation bug report, but I tried following
the instructions in the "Getting started" tutorial at "Haskell
Hacking: a journal of Haskell programming"
(http://cgi.cse.unsw.edu.au/~dons/blog/2006/12/16#programming-haskell-intro)
for GHCi 6.8.3 on Windows XP Professional (Service Pack 2), as
follows:

>You can compile this code to a native binary using GHC, by writing in a source file:
>
>    main = putStrLn "G'day, world!"
>
>and then compiling the source to native code. Assuming your file is A.hs:
>
>    $ ghc A.hs
>
>This produces a new executable, ./a.out (a.out.exe on windows), which you can run like any other program on your system:
>
>    $ ./a.out 
>    G'day, world!

However, this produced the following files, instead:

A.hi
A.o
main.exe
main.exe.manifest

There was no a.out file, and running A.o popped up a Windows dialog
box asking me to specify which application to run the program with.

So, I ran 

$ ghc --help

and found the following documentation:

>To compile and link a complete Haskell program, run the compiler like
>so:
>
>    ghc --make Main
>
>where the module Main is in a file named Main.hs (or Main.lhs) in the
>current directory.  The other modules in the program will be located
>and compiled automatically, and the linked program will be placed in
>the file `a.out' (or `Main.exe' on Windows).
>
>[...]
>
>Given the above, here are some TYPICAL invocations of ghc:
>
>    # compile a Haskell module to a .o file, optimising:
>    % ghc -c -O Foo.hs

Running

$ main.exe

produced the desired result:

>G'day, world!

Would it be possible to update the documentation to reflect the need
to enter

$ main.exe

after compilation instead of 

$ a.out

?

Thank you.

-- Benjamin L. Russell



More information about the Haskell-Cafe mailing list