2
votes

Using Hlint via the command prompt works for me, but I have problem trying to perform the GHCi integration.

http://community.haskell.org/~ndm/darcs/hlint/hlint.htm says that "the script is at hlint.ghci [link], and a copy is installed locally in the data directory. To use, add the contents to your GHCi startup file.".

C:\Users\X\AppData\Roaming\cabal\hlint-1.8.23 contains this hlint.ghci file.

Now I want to find the GHCi startup file. I am using Windows 7 and according to http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-dot-files.html the ghci.conf file should be in a folder like .../appdata/ghc. But my ghc folder (C:\Users\X\AppData\Roaming\ghc) only contains a ghci_history file.

So I copied the hlint.ghci file to my ghc folder and renamed it to ghci.conf. Starting now WinGHCi it crashes, if I start GHCi it says:

interactive>:10:91: lexical error in string/character literal at character '\n'

interactive>:4:105: lexical error in string/character literal at character '\n'

What am I doing wrong? Has the problem something to do with the missing GHCi startup file?

1
The ghci.conf(or .ghci on *nix) isn't present out of the box, you have to create one yourself if you want one. So it's not that. Encoding problem? Line ending issue?Daniel Fischer

1 Answers

7
votes

The problem was a bug with the hlint.ghci file shipped with HLint version 1.8.23 and below. HLint 1.8.24 is now available which fixes the problem, or use the online copy of hlint.ghci with an older version of HLint.

This bug was tracked by http://code.google.com/p/ndmitchell/issues/detail?id=531 and I originally said I "will probably fix it later today".