
Hi, I am indebted to Andrew Wagner for pointing me in the direction of the book http://book.realworldhaskell.org/read/ Which I now have time to study. Everything was going fine until I got to the section in Getting Started where it gives A Simple Program. Now as someone who is used to the Windows environment CLI is not my forte. Following instructions which appear to be incomplete I created a file of the program WC.hs but where should it go? I tried various places until I reread the :? For the :cd command. Ah I said that's what I need to do put it in a folder and change the Dir. Now I can find the file with the :edit command. Did the same with the file quux.txt same place. Now run the command $ runghc WC < quux.txt <interactive>:1:0: parse error on input '$' What have I done wrong or not done? It does say "at a shell or command prompt" what's that?? I reverted to the installation instructions provided by GHC for Windows. 2.2 Installing on Windows 2.2.1 Installing GHC on Windows Checked all that had been done correctly. Enter the program line 1> bash$ cat main.hs <interactive>:1:0: parse error on input '$' Now bash looks like a modified prompt?? So what is happening? Regards to all and TIA for reply. Alan Cameron

Alan,
I'd love to help you get started coding in haskell. It sounds like it
might be easier to do interactively though. Can you get on the
#haskell channel on IRC? I'm in and out of there as chessguy and will
be on later tonight.
On Jan 26, 2009, at 5:22 PM, "Alan Cameron"
Hi,
I am indebted to Andrew Wagner for pointing me in the direction of the book http://book.realworldhaskell.org/read/ Which I now have time to study. Everything was going fine until I got to the section in Getting Started where it gives A Simple Program.
Now as someone who is used to the Windows environment CLI is not my forte. Following instructions which appear to be incomplete I created a file of the program WC.hs but where should it go?
I tried various places until I reread the :? For the :cd command. Ah I said that's what I need to do put it in a folder and change the Dir.
Now I can find the file with the :edit command. Did the same with the file quux.txt same place.
Now run the command $ runghc WC < quux.txt
<interactive>:1:0: parse error on input '$'
What have I done wrong or not done?
It does say "at a shell or command prompt" what's that??
I reverted to the installation instructions provided by GHC for Windows. 2.2 Installing on Windows 2.2.1 Installing GHC on Windows
Checked all that had been done correctly.
Enter the program line 1>
bash$ cat main.hs <interactive>:1:0: parse error on input '$'
Now bash looks like a modified prompt?? So what is happening?
Regards to all and TIA for reply.
Alan Cameron
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On 1/26/2009, "Alan Cameron"
Hi,
I am indebted to Andrew Wagner for pointing me in the direction of the book http://book.realworldhaskell.org/read/ Which I now have time to study. Everything was going fine until I got to the section in Getting Started where it gives A Simple Program.
Now as someone who is used to the Windows environment CLI is not my forte. Following instructions which appear to be incomplete I created a file of the program WC.hs but where should it go?
Put it in any directory you want, but I would suggest putting it in a directory named "Chapter 1" inside another directory named "Real World Haskell".
I tried various places until I reread the :? For the :cd command. Ah I said that's what I need to do put it in a folder and change the Dir.
Now I can find the file with the :edit command. Did the same with the file quux.txt same place.
It's probably easier to just use the Windows GUI to browse to your Haskell sources and open them directly in the editor.
Now run the command $ runghc WC < quux.txt
<interactive>:1:0: parse error on input '$'
What have I done wrong or not done?
The '$' character is not actually part of the command. It's just written in the book so that you know that what follows is a command that you should type into the command line. So: $ ghci File.hs means 1) Open a console, (terminal, command line prompt or whatever you want to call it) 2) Use the cd command to go into that directory containing File.hs 3) Type (without quotes) "ghci File.hs" and press enter. Similarly, ghci> 2 + 3 means type "2 + 3" followed by enter. I hope that clears things up a bit.
participants (3)
-
Alan Cameron
-
Andrew Wagner
-
David Frey