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

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

On Wed, 27 Aug 2008 16:22:56 +0900, Benjamin L.Russell
This produces a new executable, ./a.out (a.out.exe on windows), which you can run like any other program on your system:
to read as follows:
This produces a new executable, ./a.out (main.exe on windows), which you can run like any other program on your system:
There was no "a.out.exe" on Windows, but only a "main.exe". Sorry for the confusion. -- Benjamin L. Russell

On 2008 Aug 27, at 3:28, Benjamin L.Russell wrote:
On Wed, 27 Aug 2008 16:22:56 +0900, Benjamin L.Russell
wrote: Sorry, what I really meant was not to update the reference to "a.out" to be changed to "main.exe", but to change the following line:
This produces a new executable, ./a.out (a.out.exe on windows), which you can run like any other program on your system:
to read as follows:
This produces a new executable, ./a.out (main.exe on windows), which you can run like any other program on your system:
There was no "a.out.exe" on Windows, but only a "main.exe".
Both the Unix and Windows examples need to be changed, actually; IIRC that behavior changed with 6.8. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Benjamin L.Russell
-
Brandon S. Allbery KF8NH