2-days old in Haskell

Ketil Malde ketil at ii.uib.no
Fri Jun 1 10:07:37 EDT 2007


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



More information about the Glasgow-haskell-users mailing list