
I am very new to Haskell, and I am using this webpage as a learning source: http://www.haskell.org/haskellwiki/Haskell_in_5_steps#Install_Haskell I downloaded and instal GHC and it works as was said. I tried to write my first Haskell program: prelude> "Hello World!" "Hello World, World!" it works as said. Then: (This is the problem) I would like to create a source code and compile it using GHC compiler. I opened a notepad and type this program: main = putStrLn "Hello, Word!" I saved this file as hello.hs in the same directory GHCi 6.6.1 was installed. When I tried to compile it as instucted on the webpage ( $ ghc -o hello hello.hs), I got this error message. <interactive>: 1:0: parse error on input '$' please what am I doing wrong. Thank you and sorry for your time. Tope

On Fri, 2007-06-01 at 16:00 +0200, TOPE KAREM wrote:
I opened a notepad and type this program:
main = putStrLn "Hello, Word!"
I saved this file as hello.hs in the same directory GHCi 6.6.1 was installed.
You can store it anywhere, as long as GHC is in your search path.
When I tried to compile it as instucted on the webpage ( $ ghc -o hello hello.hs), I got this error message.
<interactive>: 1:0: parse error on input '$'
please what am I doing wrong.
Several things :-) You don't usually compile from within GHCi, but rather from a system command prompt. And: the dollar sign is the typical Unix command prompt, you're not supposed to type it in. Generally, you're better off using the make option to ghc, type "ghc --make hello.hs" instead. -k

On Fri, Jun 01, 2007 at 04:07:37PM +0200, Ketil Malde wrote:
You don't usually compile from within GHCi, but rather from a system command prompt. And: the dollar sign is the typical Unix command prompt, you're not supposed to type it in.
Incidentally, I find it useful when giving examples of unix command lines to use a semicolon ';' as the prompt, as it has no effect in bourne derived shells so you can always cut-n-paste the whole line into your shell and be good to go. John -- John Meacham - ⑆repetae.net⑆john⑈

On Fri, Jun 01, 2007 at 04:00:51PM +0200, TOPE KAREM wrote:
I am very new to Haskell, and I am using this webpage as a learning source: http://www.haskell.org/haskellwiki/Haskell_in_5_steps#Install_Haskell
I downloaded and instal GHC and it works as was said.
I tried to write my first Haskell program:
prelude> "Hello World!" "Hello World, World!"
it works as said.
Then: (This is the problem)
I would like to create a source code and compile it using GHC compiler. I opened a notepad and type this program:
main = putStrLn "Hello, Word!"
I saved this file as hello.hs in the same directory GHCi 6.6.1 was installed.
When I tried to compile it as instucted on the webpage ( $ ghc -o hello hello.hs), I got this error message.
<interactive>: 1:0: parse error on input '$'
please what am I doing wrong.
Thank you and sorry for your time.
Three things: 1. The $ is just a sample prompt, a convention used to indicate what you should typed. 2. The command is for a shell (CMD or COMMAND), not GHCi. 3. The command is wrong! for Windows it should be "ghc -o hello.exe hello.hs". Assuming you aren't knowledgable yet on the differences between Windows and Unix programming environments, it might be a good idea to pick another tutorial. Stefan

Thanks to all ( Stefan, Ketil and Brown). It works both on Linux and
Windows.
Tope
On 6/2/07, Stefan O'Rear
I am very new to Haskell, and I am using this webpage as a learning
On Fri, Jun 01, 2007 at 04:00:51PM +0200, TOPE KAREM wrote: source:
http://www.haskell.org/haskellwiki/Haskell_in_5_steps#Install_Haskell
I downloaded and instal GHC and it works as was said.
I tried to write my first Haskell program:
prelude> "Hello World!" "Hello World, World!"
it works as said.
Then: (This is the problem)
I would like to create a source code and compile it using GHC compiler. I opened a notepad and type this program:
main = putStrLn "Hello, Word!"
I saved this file as hello.hs in the same directory GHCi 6.6.1 was installed.
When I tried to compile it as instucted on the webpage ( $ ghc -o hello hello.hs), I got this error message.
<interactive>: 1:0: parse error on input '$'
please what am I doing wrong.
Thank you and sorry for your time.
Three things:
1. The $ is just a sample prompt, a convention used to indicate what you should typed.
2. The command is for a shell (CMD or COMMAND), not GHCi.
3. The command is wrong! for Windows it should be "ghc -o hello.exe hello.hs". Assuming you aren't knowledgable yet on the differences between Windows and Unix programming environments, it might be a good idea to pick another tutorial.
Stefan
participants (5)
-
C.M.Brown
-
John Meacham
-
Ketil Malde
-
Stefan O'Rear
-
TOPE KAREM