Heres my code:
factorial :: Integer -> Integer
factorial n = product [1..n]
main = print(factorial 50)
I don't get any errors compiling, but when i run the compiled code
runhaskell test
I get this error:
test:1:1: lexical error at character '\DEL'
What is causing this? How do I solve the problem?
UPDATES
I did a hexdump of the file:
$ hexdump -x test.hs
and got
0000000 6166 7463 726f 6169 206c 3a3a 4920 746e
0000010 6765 7265 2d20 203e 6e49 6574 6567 0a72
0000020 6166 7463 726f 6169 206c 206e 203d 7270
0000030 646f 6375 2074 315b 2e2e 5d6e 6d0a 6961
0000040 206e 203d 7270 6e69 2874 6166 7463 726f
0000050 6169 206c 3035 0029
0000057
0x7f
in it. – paxdiablo0x7f
. please see edit – dopatramanrunhaskell test.hs
(with the extension). Are you sure you're not picking up a binary file called justtest
somewhere? – paxdiablorunHaskell
on the compiled binary, and got the same error message. @dopatraman- runHaskell is an interpreter, it takes source code, if you have a compiled binary you can run it directly. – jamshidh-- test.hs
line at the top. – paxdiablo