Mikael Johansson writes:

> module Main (main) where
> main = putStrLn "Hello World"
> end
> 
> with the command
> 
> ghc Hello.lhs
> 
> I get the message on standard output:
> 
> No definitions in file <perhaps you forgot the '>'s?>


.lhs means "literate Haskell file".  Try


> module Main (main) where
> main = putStrLn "Hello World"

(the "end" isn't legal Haskell).  The ">" at the beginning of the line are called 
"Bird tracks" (after Richard Bird), and mark the lines of a literate Haskell program 
that are actually code.  Lines without them are just comments.

Or try

\begin{code}
module Main (main) where
main = putStrLn "Hello World"
\end{code}

which is another way of marking code.

The final way, probably the easiest, is simply to put your program in a file called 
Hello.hs  rather than Hello.lhs.  The .hs extension means "ordinary Haskell code".

HTH.

--KW 8-)
-- 
Keith Wansbrough <[EMAIL PROTECTED]>
http://www.cl.cam.ac.uk/users/kw217/
Cambridge University Computer Laboratory.


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to