Newbie problem: lexical error when compiling

Hi, I'm new to GHC and am having a problem compiling a simple test program. I recently installed ghc 6.6.1 on my Windows Vista machine. I can ghci ok. For instance, I defined the factorial function and tested it on a few values. So the interpreter seems to work fine. As a next step I created a file called hello.hs (UTF-8 encoding) containing the single line: main = putStrLn "Hello world!" I opened a windows console, navigated to the folder containing this Haskell file and typed 'ghc -o hello hello.hs' and received the following error: hello.hs:1:0 lexical error at character '\65279'. If I type 'ghc -o hello.exe hello.hs' I get the same error. Anybody know what the problem is here and how to fix it? Thanks. Regards, David

David Schonberger
'ghc -o hello hello.hs' and received the following error: hello.hs:1:0 lexical error at character '\65279'.
See http://en.wikipedia.org/wiki/Byte_Order_Mark Somehow you'll have to persuade you editor not to use the BOM, or make GHC accept it... Neither of which I can help you. -- Regards, Feri.

Wagner Ferenc
David Schonberger
writes: 'ghc -o hello hello.hs' and received the following error: hello.hs:1:0 lexical error at character '\65279'.
See http://en.wikipedia.org/wiki/Byte_Order_Mark Somehow you'll have to persuade you editor not to use the BOM, or make GHC accept it... Neither of which I can help you.
Or one thing, after all: since your source is pure ASCII, don't save is as UTF-8. 7-bit ASCII and UTF-8 are compatible. -- Feri.

On Sun, Sep 16, 2007 at 10:05:53PM +0200, Wagner Ferenc wrote:
David Schonberger
writes: 'ghc -o hello hello.hs' and received the following error: hello.hs:1:0 lexical error at character '\65279'.
See http://en.wikipedia.org/wiki/Byte_Order_Mark Somehow you'll have to persuade you editor not to use the BOM, or make GHC accept it... Neither of which I can help you.
I've filed a bug here: http://hackage.haskell.org/trac/ghc/ticket/1744 Thanks Ian
participants (3)
-
David Schonberger
-
Ian Lynagh
-
Wagner Ferenc