
I have just started trying to learn Haskell again (I seem to have a mental block against this language). Right now I'm using Haskell in 5 steps. I have created the file hello.hs exactly as in the section "Write your first Haskell program". I then opened a cmd (I'm using Windows) window in the directory where I created hello.hs and entered "ghc -o hello hello.hs". What follows is the output of the cmd window: hello.hs:1:7: Not in scope: data constructor `PutStrLn' Can someone tell me why I am having this problem? Regards Chris Saunders

Try putStrLn.
-deech
On Fri, Jun 25, 2010 at 12:50 AM, Chris Saunders
I have just started trying to learn Haskell again (I seem to have a mental block against this language). Right now I'm using Haskell in 5 steps. I have created the file hello.hs exactly as in the section "Write your first Haskell program". I then opened a cmd (I'm using Windows) window in the directory where I created hello.hs and entered "ghc -o hello hello.hs". What follows is the output of the cmd window:
hello.hs:1:7: Not in scope: data constructor `PutStrLn'
Can someone tell me why I am having this problem?
Regards Chris Saunders _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Thanks very much Aditya. The language I use most is Eiffel which is case
insensitive so I'm not accustomed to seeing such errors.
Regards
Chris Saunders
--------------------------------------------------
From: "aditya siram"
Try putStrLn. -deech
On Fri, Jun 25, 2010 at 12:50 AM, Chris Saunders
wrote: I have just started trying to learn Haskell again (I seem to have a mental block against this language). Right now I'm using Haskell in 5 steps. I have created the file hello.hs exactly as in the section "Write your first Haskell program". I then opened a cmd (I'm using Windows) window in the directory where I created hello.hs and entered "ghc -o hello hello.hs". What follows is the output of the cmd window:
hello.hs:1:7: Not in scope: data constructor `PutStrLn'
Can someone tell me why I am having this problem?
Regards Chris Saunders _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Friday 25 June 2010 06:50:06, Chris Saunders wrote:
I have just started trying to learn Haskell again (I seem to have a mental block against this language). Right now I'm using Haskell in 5 steps. I have created the file hello.hs exactly as in the section "Write your first Haskell program". I then opened a cmd (I'm using Windows) window in the directory where I created hello.hs and entered "ghc -o hello hello.hs".
The matter with upper/lower case has already been treated, so I'll focus on the command line. Unless you know exactly that you can't use the --make option and why, always compile with ghc --make [other options if wanted] file[s] without --make, you'll get some puzzling 'undefined symbol' messages from the linker sooner rather than later.
What follows is the output of the cmd window:
hello.hs:1:7: Not in scope: data constructor `PutStrLn'
Can someone tell me why I am having this problem?
Regards Chris Saunders

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. The second is closer to the command line
that I used when I had the case error in the source code.
Regards
Chris Saunders
--------------------------------------------------
From: "Daniel Fischer"
On Friday 25 June 2010 06:50:06, Chris Saunders wrote:
I have just started trying to learn Haskell again (I seem to have a mental block against this language). Right now I'm using Haskell in 5 steps. I have created the file hello.hs exactly as in the section "Write your first Haskell program". I then opened a cmd (I'm using Windows) window in the directory where I created hello.hs and entered "ghc -o hello hello.hs".
The matter with upper/lower case has already been treated, so I'll focus on the command line.
Unless you know exactly that you can't use the --make option and why, always compile with
ghc --make [other options if wanted] file[s]
without --make, you'll get some puzzling 'undefined symbol' messages from the linker sooner rather than later.
What follows is the output of the cmd window:
hello.hs:1:7: Not in scope: data constructor `PutStrLn'
Can someone tell me why I am having this problem?
Regards Chris Saunders
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

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
participants (3)
-
aditya siram
-
Chris Saunders
-
Daniel Fischer