[Haskell-cafe] apparent minor bug in "Getting started" tutorial at
"Haskell Hacking: a journal of Haskell programming"
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"
for GHCi 6.8.3 on Windows XP Professional (Service Pack 2), as
>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:
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
> 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
produced the desired result:
Would it be possible to update the documentation to reflect the need
after compilation instead of
-- Benjamin L. Russell
More information about the Haskell-Cafe