Question

I have developed a haskell application which is tested with WinHugs interpreter working fine .. when i try to comiple the same application using WinGHCi it prompts a error

   lexical error in string/character literal at character '\t'

I have used \t in IO Program to display text

Example :- putStr "\n \n \t \t Hello ! "

Any solutions ?

Was it helpful?

Solution

You may want to try this step-by-step guide:

  1. Save your program in a file program.hs this file should contain a function main of the type IO () that is executed at the program's start.
  2. Open a shell in the directory where this file is.
  3. Type ghc -O3 --make program.hs to compile program.hs into an executable program.exe.
  4. Try to run program.exe

If the error still occurs, please post some more code to aid debugging.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top